Skip to content

Commit 46a7525

Browse files
committed
Update install.shhssh✋
1 parent 721c611 commit 46a7525

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

install.sh

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Info_font_prefix="\033[32m" && Error_font_prefix="\033[31m" && Info_background_p
1212
install_path='/root/auxpi'
1313
auxpi_path="${install_path}/build/linux"
1414
name="auxpi"
15+
ver="2.0.1"
1516

1617
echo -e "
1718
#=================================================
@@ -34,34 +35,34 @@ function auxpi_help(){
3435
}
3536

3637
check_sys(){
37-
if [[ -f /etc/redhat-release ]]; then
38-
release="centos"
39-
elif cat /etc/issue | grep -q -E -i "debian"; then
40-
release="debian"
41-
elif cat /etc/issue | grep -q -E -i "ubuntu"; then
42-
release="ubuntu"
43-
elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
44-
release="centos"
45-
elif cat /proc/version | grep -q -E -i "debian"; then
46-
release="debian"
47-
elif cat /proc/version | grep -q -E -i "ubuntu"; then
48-
release="ubuntu"
49-
elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
50-
release="centos"
38+
if [[ -f /etc/redhat-release ]]; then
39+
release="centos"
40+
elif cat /etc/issue | grep -q -E -i "debian"; then
41+
release="debian"
42+
elif cat /etc/issue | grep -q -E -i "ubuntu"; then
43+
release="ubuntu"
44+
elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
45+
release="centos"
46+
elif cat /proc/version | grep -q -E -i "debian"; then
47+
release="debian"
48+
elif cat /proc/version | grep -q -E -i "ubuntu"; then
49+
release="ubuntu"
50+
elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
51+
release="centos"
5152
fi
52-
bit=$(uname -m)
53+
bit=$(uname -m)
5354
}
5455

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

5960
function install() {
6061
[[ -e "${install_path}/auxpi" ]] && echo -e "${Error_font_prefix}[ERROR]${Font_suffix}已经安装无需再次安装" && exit 1
6162
check_root
6263
mkdir -p $install_path
6364
cd $install_path
64-
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"
65+
wget --no-check-certificate -O "auxpi.tar.gz" "https://github.com/aimerforreimu/AUXPI/releases/download/${ver}/auxpi-${ver}-linux.tar.gz"
6566
[[ ! -e "auxpi.tar.gz" ]] && echo -e "${Error_font_prefix}[ERROR]${Font_suffix} auxpi 下载失败" && exit 1
6667
tar zxvf "auxpi.tar.gz"
6768
rm -rf "auxpi.tar.gz"

models/users.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type User struct {
1717
Token string `gorm:"UNIQUE" json:"token"`
1818
Version uint `json:"version"`
1919

20-
RoleID uint `gorm:"UNIQUE_INDEX;" json:"role_id"`
20+
RoleID uint `gorm:"INDEX;" json:"role_id"`
2121
Role Role `json:"role"`
2222

2323
Image []Image `json:"images" json:"image"`

0 commit comments

Comments
 (0)