Skip to content

Commit

Permalink
Update install.shhssh✋
Browse files Browse the repository at this point in the history
  • Loading branch information
aimerforreimu committed Mar 14, 2019
1 parent 721c611 commit 46a7525
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
35 changes: 18 additions & 17 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Info_font_prefix="\033[32m" && Error_font_prefix="\033[31m" && Info_background_p
install_path='/root/auxpi'
auxpi_path="${install_path}/build/linux"
name="auxpi"
ver="2.0.1"

echo -e "
#=================================================
Expand All @@ -34,34 +35,34 @@ function auxpi_help(){
}

check_sys(){
if [[ -f /etc/redhat-release ]]; then
release="centos"
elif cat /etc/issue | grep -q -E -i "debian"; then
release="debian"
elif cat /etc/issue | grep -q -E -i "ubuntu"; then
release="ubuntu"
elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
release="centos"
elif cat /proc/version | grep -q -E -i "debian"; then
release="debian"
elif cat /proc/version | grep -q -E -i "ubuntu"; then
release="ubuntu"
elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
release="centos"
if [[ -f /etc/redhat-release ]]; then
release="centos"
elif cat /etc/issue | grep -q -E -i "debian"; then
release="debian"
elif cat /etc/issue | grep -q -E -i "ubuntu"; then
release="ubuntu"
elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
release="centos"
elif cat /proc/version | grep -q -E -i "debian"; then
release="debian"
elif cat /proc/version | grep -q -E -i "ubuntu"; then
release="ubuntu"
elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
release="centos"
fi
bit=$(uname -m)
bit=$(uname -m)
}

check_root(){
[[ $EUID != 0 ]] && echo -e "${Error} 当前非ROOT账号(或没有ROOT权限),无法继续操作,请更换ROOT账号或使用 ${Green_background_prefix}sudo su${Font_color_suffix} 命令获取临时ROOT权限(执行后可能会提示输入当前账号的密码)。" && exit 1
[[ $EUID != 0 ]] && echo -e "${Error} 当前非ROOT账号(或没有ROOT权限),无法继续操作,请更换ROOT账号或使用 ${Green_background_prefix}sudo su${Font_color_suffix} 命令获取临时ROOT权限(执行后可能会提示输入当前账号的密码)。" && exit 1
}

function install() {
[[ -e "${install_path}/auxpi" ]] && echo -e "${Error_font_prefix}[ERROR]${Font_suffix}已经安装无需再次安装" && exit 1
check_root
mkdir -p $install_path
cd $install_path
wget --no-check-certificate -O "auxpi.tar.gz" "https://github.com/aimerforreimu/AUXPI/releases/download/2.0.0/auxpi-2.0.0-linux.tar.gz"
wget --no-check-certificate -O "auxpi.tar.gz" "https://github.com/aimerforreimu/AUXPI/releases/download/${ver}/auxpi-${ver}-linux.tar.gz"
[[ ! -e "auxpi.tar.gz" ]] && echo -e "${Error_font_prefix}[ERROR]${Font_suffix} auxpi 下载失败" && exit 1
tar zxvf "auxpi.tar.gz"
rm -rf "auxpi.tar.gz"
Expand Down
2 changes: 1 addition & 1 deletion models/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type User struct {
Token string `gorm:"UNIQUE" json:"token"`
Version uint `json:"version"`

RoleID uint `gorm:"UNIQUE_INDEX;" json:"role_id"`
RoleID uint `gorm:"INDEX;" json:"role_id"`
Role Role `json:"role"`

Image []Image `json:"images" json:"image"`
Expand Down

0 comments on commit 46a7525

Please sign in to comment.