~修复数据库无法下载的bug
This commit is contained in:
juewuy
2024-01-04 23:05:00 +08:00
parent e93af12812
commit 809a5b224c
3 changed files with 47 additions and 43 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1018,16 +1018,6 @@ setgeo(){
}
getdb(){
#下载及安装
if [ -f /www/clash/CNAME -o -f $CRASHDIR/ui/CNAME ];then
echo -----------------------------------------------
echo -e "\033[31m检测到您已经安装过本地面板了\033[0m"
echo -----------------------------------------------
read -p "是否覆盖安装?[1/0] > " res
if [ "$res" = 1 ]; then
rm -rf /www/clash
rm -rf $CRASHDIR/ui
rm -rf $bindir/ui
dblink="${update_url}/bin/dashboard/${db_type}.tar.gz"
echo -----------------------------------------------
echo 正在连接服务器获取安装文件…………
@@ -1060,15 +1050,25 @@ getdb(){
echo -e "\033[32m面板安装成功\033[0m"
rm -rf $TMPDIR/clashdb.tar.gz
fi
else
echo -e "\033[33m安装已取消\033[0m"
fi
fi
sleep 1
}
setdb(){
dbdir(){
if [ -w /www -a -n "$(pidof nginx)" ];then
if [ -f /www/clash/CNAME -o -f $CRASHDIR/ui/CNAME ];then
echo -----------------------------------------------
echo -e "\033[31m检测到您已经安装过本地面板了\033[0m"
echo -----------------------------------------------
read -p "是否覆盖安装?[1/0] > " res
if [ "$res" = 1 ]; then
rm -rf $bindir/ui
[ -f /www/clash/CNAME ] && rm -rf /www/clash && dbdir=/www/clash
[ -f $CRASHDIR/ui/CNAME ] && rm -rf $CRASHDIR/ui && dbdir=$CRASHDIR/ui
getdb
else
setdb
echo -e "\033[33m安装已取消\033[0m"
fi
elif [ -w /www -a -n "$(pidof nginx)" ];then
echo -----------------------------------------------
echo -e "请选择面板\033[33m安装目录\033[0m"
echo -----------------------------------------------
@@ -1081,15 +1081,19 @@ setdb(){
if [ "$num" = '1' ]; then
dbdir=$CRASHDIR/ui
hostdir=":$db_port/ui"
getdb
elif [ "$num" = '2' ]; then
dbdir=/www/clash
hostdir='/clash'
getdb
else
setdb
echo -e "\033[33m安装已取消\033[0m"
fi
else
dbdir=$CRASHDIR/ui
hostdir=":$db_port/ui"
getdb
fi
}