Update install.shhssh

dev 2.3.0
aimerforreimu 5 years ago
parent 721c611f66
commit 46a752557c
  1. 35
      install.sh
  2. 2
      models/users.go

@ -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 "
#=================================================
@ -34,26 +35,26 @@ 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() {
@ -61,7 +62,7 @@ function install() {
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"

@ -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"`

Loading…
Cancel
Save