From e4aa9d702d25c52aa06887ff1c24d78b41d01cb6 Mon Sep 17 00:00:00 2001 From: juewuy Date: Fri, 14 Aug 2020 16:42:52 +0800 Subject: [PATCH] =?UTF-8?q?v0.9.1=20~=E6=96=B0=E5=A2=9E=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=94=AF=E6=8C=81=EF=BC=8C=E7=90=86=E8=AE=BA?= =?UTF-8?q?=E4=B8=8A=E6=94=AF=E6=8C=81=E5=B0=8F=E7=B1=B3=E5=85=A8=E7=B3=BB?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E5=99=A8=E8=AE=BE=E5=A4=87=EF=BC=88=E5=BE=85?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=EF=BC=89=20~=E5=A2=9E=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E5=AF=B9=E8=AE=BE=E5=A4=87=E6=A0=B8=E5=BF=83=E6=9E=B6=E6=9E=84?= =?UTF-8?q?=E7=9A=84=E8=87=AA=E5=8A=A8=E6=A3=80=E6=B5=8B=EF=BC=8C=E9=80=82?= =?UTF-8?q?=E9=85=8Darmv5=EF=BC=8Carmv7=EF=BC=8Carmv8=EF=BC=88aarch64?= =?UTF-8?q?=EF=BC=89=EF=BC=8Cmipsle=E5=8F=8Ax86=E5=B9=B3=E5=8F=B0=20~?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E4=B8=80=E9=83=A8=E5=88=86acl?= =?UTF-8?q?=E8=A7=84=E5=88=99=E6=A8=A1=E7=89=88=20~=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BA=86=E5=87=A0=E5=A4=84=E5=81=B6=E5=B0=94=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E7=9A=84=E5=B0=8Fbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/clashfm.tar.gz | Bin 11405 -> 11405 bytes bin/version | 2 +- scripts/clash.sh | 51 ++++++++++++++++++++++++--------------------- scripts/getdate.sh | 19 ++++++++++++----- 4 files changed, 42 insertions(+), 30 deletions(-) diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index e62174e34cfc616f28068f3cbfabadf78dbfb728..776bc61d5b65ae15be1c18f75861b510ed597db8 100644 GIT binary patch delta 15 WcmeB;?2TlT@8;mh_ua_Wt^)ukg9Nhx delta 15 WcmeB;?2TlT@8;k*W3`d3T?YUuQUv_~ diff --git a/bin/version b/bin/version index ecdacae..2358b0a 100644 --- a/bin/version +++ b/bin/version @@ -1 +1 @@ -versionsh=0.9.0 +versionsh=0.9.1 diff --git a/scripts/clash.sh b/scripts/clash.sh index 7dd8e48..1de0d09 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -3,13 +3,13 @@ getconfig(){ #版本号 -versionsh_l=0.9.0 +#versionsh_l=0.9.0 #服务器地址 -if [ -z $update_url ]; then +if [ -z "$update_url" ]; then update_url=https://cdn.jsdelivr.net/gh/juewuy/clash-for-Miwifi/ fi #文件路径 -if [ -z $clashdir ];then +if [ -z "$clashdir" ];then clashdir=$(dirname $(readlink -f "$0")) echo "export clashdir=\"$clashdir\"" >> /etc/profile fi @@ -32,7 +32,7 @@ else auto1="\033[36m允许\033[0mclash开机启动" fi #获取运行模式 -if [ ! -n "$redir_mod" ]; then +if [ -z "$redir_mod" ]; then sed -i "2i\redir_mod=Redir模式" $ccfg redir_mod=Redir模式 fi @@ -91,8 +91,8 @@ status=`ps |grep -w 'clash -d'|grep -v grep|wc -l` echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[32mclash服务已启动!\033[0m" echo -e "可以使用\033[30;47m http://clash.razord.top \033[0m管理内置规则" - echo -e "也可以前往更新菜单安装本地Dashboard面板,连接更稳定!!!" - echo -e "Host地址:\033[36m $host \033[0m 端口:\033[36m 9999 \033[0m" + echo -e "Host地址:\036[33m $host \033[0m 端口:\033[36m 9999 \033[0m" + echo -e "也可前往更新菜单安装本地Dashboard面板,连接更稳定!\033[0m" else echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31mclash服务启动失败!请检查配置文件!\033[0m" @@ -100,13 +100,13 @@ status=`ps |grep -w 'clash -d'|grep -v grep|wc -l` } clashlink(){ #获取订阅规则 -if [ ! -n "$rule_link" ]; then +if [ -z "$rule_link" ]; then sed -i '/rule_link=*/'d $ccfg sed -i "4i\rule_link=1" $ccfg rule_link=1 fi #获取后端服务器地址 -if [ ! -n "$server_link" ]; then +if [ -z "$server_link" ]; then sed -i '/server_link=*/'d $ccfg sed -i "5i\server_link=1" $ccfg server_link=1 @@ -122,7 +122,7 @@ echo -e " 5 \033[36m还原\033[0m配置文件" echo -e " 6 \033[32m手动更新\033[0m订阅" echo -e " 0 返回上级菜单" read -p "请输入对应数字 > " num -if [ -z $num ];then +if [ -z "$num" ];then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" clashsh @@ -166,9 +166,12 @@ elif [[ $num == 3 ]];then echo 3 ACL4SSR通用版去广告加强 echo 4 ACL4SSR精简版去广告加强 echo 5 ACL4SSR通用版无去广告 + echo 6 ACL4SSR通用版无自动测速 + echo 7 ACL4SSR精简版无自动测速 + echo 8 ACL4SSR超重度奈飞全量 echo 0 返回上级菜单 read -p "请输入对应数字 > " num - if [ -z $num ];then + if [ -z "$num" ];then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" clashlink @@ -194,7 +197,7 @@ elif [[ $num == 4 ]];then echo 7 subconvert.dreamcloud.pw echo 0 返回上级菜单 read -p "请输入对应数字 > " num - if [ -z $num ];then + if [ -z "$num" ];then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" clashlink @@ -230,7 +233,7 @@ elif [[ $num == 5 ]];then fi clashsh elif [[ $num == 6 ]];then - if [ ! -n "$Url" ];then + if [ -z "$Url" ];then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo 没有找到你的订阅链接!请先输入链接! clashlink @@ -257,19 +260,19 @@ fi } clashadv(){ #获取设置默认显示 -if [ ! -n "$skip_cert" ]; then +if [ -z "$skip_cert" ]; then skip_cert=已开启 fi -if [ ! -n "$common_ports" ]; then +if [ -z "$common_ports" ]; then common_ports=未开启 fi -if [ ! -n "$dns_mod" ]; then +if [ -z "$dns_mod" ]; then dns_mod=redir_host fi -if [ ! -n "$modify_yaml" ]; then +if [ -z "$modify_yaml" ]; then modify_yaml=未开启 fi -if [ ! -n "$ipv6_support" ]; then +if [ -z "$ipv6_support" ]; then ipv6_support=未开启 fi # @@ -306,7 +309,7 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then echo " 不推荐使用redir-host" echo " 0 返回上级菜单" read -p "请输入对应数字 > " num - if [ -z $num ]; then + if [ -z "$num" ]; then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" clashadv @@ -353,7 +356,7 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then echo " 不支持Tun模式" echo " 0 返回上级菜单" read -p "请输入对应数字 > " num - if [ -z $num ]; then + if [ -z "$num" ]; then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" clashadv @@ -535,7 +538,7 @@ clashcron(){ echo -e " 输入 9 \033[31m删除定时任务\033[0m" echo -e " 输入 0 返回上级菜单" read -p "请输入对应数字 > " num - if [ -z $num ]; then + if [ -z "$num" ]; then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" clashcron @@ -558,7 +561,7 @@ clashcron(){ #设置具体时间 echo ----------------------------------------------- read -p "请输入小时(0-23) > " num - if [ -z $num ]; then + if [ -z "$num" ]; then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" setcron @@ -571,7 +574,7 @@ clashcron(){ fi echo ----------------------------------------------- read -p "请输入分钟(0-60) > " num - if [ -z $num ]; then + if [ -z "$num" ]; then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" setcron @@ -622,7 +625,7 @@ echo -e " 3 设置\033[32m定时开启\033[0mclash服务" echo -e " 4 设置\033[33m定时更新\033[0m订阅链接(实验性,可能不稳定)" echo -e " 0 返回上级菜单" read -p "请输入对应数字 > " num -if [ -z $num ]; then +if [ -z "$num" ]; then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" clashsh @@ -726,7 +729,7 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then echo " 6 测试代理服务器连通性(google.tw)" echo " 0 返回上级目录!" read -p "请输入对应数字 > " num - if [ -z $num ]; then + if [ -z "$num" ]; then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" clashsh diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 8231f98..93a7433 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -20,6 +20,9 @@ https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_On https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_AdblockPlus.ini https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_AdblockPlus.ini https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoReject.ini +https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoAuto.ini +https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_NoAuto.ini +https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_Netflix.ini EOF` #如果传来的是Url链接则合成Https链接,否则直接使用Https链接 if [ -z $Https ];then @@ -81,8 +84,8 @@ else host=$(ubus call network.interface.lan status | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}';) echo -e "Host地址:\033[30;46m $host \033[0m;端口:\033[30;46m 9999 \033[0m" #将用户链接写入mark - sed -i '/Https=*/'d $ccfg - sed -i "7i\Https=\'$Https\'" $ccfg + #sed -i '/Https=*/'d $ccfg + #sed -i "7i\Https=\'$Https\'" $ccfg clashsh else echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -269,9 +272,15 @@ if [ ! -f $clashdir/clash ]; then clashcore=没有安装核心! clashv='' fi - -cpucore=armv7 clashcore_n=$clashcore +#获取设备处理器架构 +cpucore=$(uname -ms | tr ' ' '_' | tr '[A-Z]' '[a-z]') +[ -n "$(echo $cpucore | grep -E "linux.*aarch64.*")" ] && cpucore="armv8" +[ -n "$(echo $cpucore | grep -E "linux.*armv7.*")" ] && cpucore="armv7" +[ -n "$(echo $cpucore | grep -E "linux.*armv5.*")" ] && cpucore="armv5" +[ -n "$(echo $cpucore | grep -E "linux.*mips.*")" ] && cpucore="mipsle-softfloat" +[ -n "$(echo $cpucore | grep -E "linux.*x86.*")" ] && cpucore="386" +### echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "当前clash核心:\033[47;30m $clashcore \033[46;30m$clashv\033[0m" echo -e "\033[32m请选择需要下载的核心版本!\033[0m" @@ -445,7 +454,7 @@ echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[30;47m您可以在此处切换在线更新时使用的资源地址\033[0m" echo -e "当前源:\033[4;32m$update_url\033[0m" echo ----------------------------------------------- -echo -e " 1 CDN源(感谢\033[4;32mwww.jsdelivr.com\033[0m,推荐)" +echo -e " 1 CDN源(可能有一定的同步延迟)" echo -e " 2 Github源(不稳定,不推荐)" echo -e " 3 Github源+clash代理(需开启clash服务,推荐)" echo -e " 4 自定义输入(请务必确保路径正确)"