From 7772e826311af3e959507d25243c36c4c4a1f971 Mon Sep 17 00:00:00 2001 From: juewuy Date: Mon, 23 Jan 2023 16:14:53 +0800 Subject: [PATCH] =?UTF-8?q?v1.7.0=20~=E4=BC=98=E5=8C=96=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E5=8F=8A=E5=AE=89=E8=A3=85=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=20~=E5=90=88=E5=B9=B6https://github.com/juewuy/ShellClash/pull?= =?UTF-8?q?/309?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 36 ++++++++++++++++++------------------ scripts/getdate.sh | 2 +- scripts/init.sh | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/install.sh b/install.sh index a9c7fbb..3d3a356 100644 --- a/install.sh +++ b/install.sh @@ -210,25 +210,25 @@ if [ "$USER" != "root" -a -z "$systype" ];then fi #检查更新 -url_cdn="https://raw.fastgit.org/juewuy/ShellClash" +url_cdn="https://fastly.jsdelivr.net/gh/juewuy/ShellClash" [ -z "$url" ] && url=$url_cdn -# echo ----------------------------------------------- -# $echo "\033[33m请选择想要安装的版本:\033[0m" -# $echo " 1 \033[36mShellclash稳定版\033[0m" -# $echo " 2 \033[32mShellclash公测版\033[0m(推荐)" -# echo ----------------------------------------------- -# read -p "请输入相应数字 > " num -# if [ -z $num ];then - # echo 安装已取消! && exit 1; -# elif [ "$num" = "1" ];then - # webget /tmp/clashrelease $url_cdn/master/bin/release_version echoon rediroff 2>/tmp/clashrelease - # if [ "$result" = "200" ];then - # release_new=$(cat /tmp/clashrelease | head -1) - # url_dl="$url_cdn/$release_new" - # else - # $echo "\033[33m无法获取稳定版安装地址,将尝试安装公测版!\033[0m" - # fi -# fi +echo ----------------------------------------------- +$echo "\033[33m请选择想要安装的版本:\033[0m" +$echo " 1 \033[32mShellclash公测版\033[0m" +$echo " 2 \033[36mShellclash稳定版\033[0m" +echo ----------------------------------------------- +read -p "请输入相应数字 > " num +if [ -z $num ];then + echo 安装已取消! && exit 1; +elif [ "$num" = "2" ];then + webget /tmp/clashrelease $url_cdn@master/bin/release_version echoon rediroff 2>/tmp/clashrelease + if [ "$result" = "200" ];then + release_new=$(cat /tmp/clashrelease | head -1) + url_dl="$url_cdn@$release_new" + else + $echo "\033[33m无法获取稳定版安装地址,将尝试安装公测版!\033[0m" + fi +fi [ -z "$url_dl" ] && url_dl=$url webget /tmp/clashversion "$url_dl/bin/version" echooff [ "$result" = "200" ] && versionsh=$(cat /tmp/clashversion | grep "versionsh" | awk -F "=" '{print $2}') diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 787583f..187e55d 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -345,7 +345,7 @@ gettar(){ echo -e "\033[33m文件解压失败!\033[0m" error_down else - setconfig versionsh_l $release_new + source $clashdir/init.sh >/dev/null echo -e "\033[32m脚本更新成功!\033[0m" fi fi diff --git a/scripts/init.sh b/scripts/init.sh index 685d70c..c0526a7 100644 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -145,7 +145,7 @@ mv -f /tmp/SC_tmp/* $clashdir 2>/dev/null #初始化 [ -f "$clashdir/mark" ] || echo '#ShellClash配置文件,不明勿动!' > $clashdir/mark #本地安装跳过新手引导 -setconfig userguide 1 +[ -z "$url" ] && setconfig userguide 1 #判断系统类型写入不同的启动文件 if [ -f /etc/rc.common ];then #设为init.d方式启动