diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index 4bf2517..1d4a4d1 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/bin/version b/bin/version index 87eef77..1d41124 100644 --- a/bin/version +++ b/bin/version @@ -1,4 +1,4 @@ GeoIP_v=20201001 clash_v=1.1.0 clashpre_v=2020.09.27 -versionsh=1.0.0beta13 +versionsh=1.0.0beta13fix1 diff --git a/scripts/clash.sh b/scripts/clash.sh index bc37e08..01c70d7 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -522,7 +522,7 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then clashcfg elif [ $num -le $(cat /tmp/dhcp.leases | awk 'END{print NR}') ]; then macadd=$(cat /tmp/dhcp.leases | awk '{print $2}' | sed -n "$num"p) - if [ -z $(cat $clashdir/mac | grep -E "$macadd") ];then + if [ -z "$(cat $clashdir/mac | grep -E "$macadd")" ];then echo $macadd >> $clashdir/mac echo ----------------------------------------------- echo 已添加的mac地址: diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 9078adb..4ee9f06 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -38,22 +38,22 @@ fi linkserver(){ echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[44m 实验性功能,遇问题请加TG群反馈:\033[42;30m t.me/clashfm \033[0m" +echo -e "\033[36m 感谢 https://github.com/tindy2013/subconverter \033[0m" echo 当前使用后端为:$server_link -echo 1 subconverter-web.now.sh +echo 1 subcon.dlj.tf echo 2 subconverter.herokuapp.com echo 3 subcon.py6.pw echo 4 api.dler.io echo 5 api.wcc.best -echo 6 skapi.cool echo ----------------------------------------------- echo 0 返回上级菜单 read -p "请输入对应数字 > " num -if [ -z "$num" ] || [[ $num -gt 6 ]];then +if [ -z "$num" ] || [[ $num -gt 5 ]];then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" elif [[ "$num" = 0 ]];then echo -elif [[ $num -le 6 ]];then +elif [[ $num -le 5 ]];then #将对应标记值写入mark sed -i '/server_link*/'d $ccfg sed -i "4i\server_link="$num"" $ccfg @@ -88,7 +88,7 @@ sed -i "1i\exclude=\'$exclude\'" $ccfg linkset } linkset(){ -if [ -n $Url ];then +if [ -n "$Url" ];then [ -z "$skip_cert" ] && skip_cert=已开启 echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[47;30m请检查输入的链接是否正确:\033[0m" @@ -174,7 +174,7 @@ do Url="$Url"\|"$url" fi i=$(($i+1)) - elif [ -z $url ];then + elif [ -z "$url" ];then [ -n "$Url" ] && linkset elif [[ $url == 0 ]];then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -202,32 +202,30 @@ echo ----------------------------------------------- echo -e "\033[33m0 返回上级菜单\033[0m" echo ----------------------------------------------- read -p "请输入完整链接 > " Https -test=$(echo $Https | grep "://") +test=$(echo $Https | grep -iE "http.*://" ) Https=`echo ${Https/\ \(*\)/''}` #删除恶心的超链接内容 -#Https=`echo ${Https//\&/\%26}` #将分隔符 & 替换成Httpscode:%26 -if [ -n $Https ];then - if [ -n $test ];then - echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - echo -e 请检查输入的链接是否正确: - echo -e "\033[4m$Https\033[0m" - read -p "确认导入配置文件?原配置文件将被更名为config.yaml.bak![1/0] > " res - if [ "$res" = '1' ]; then - #将用户链接写入mark - sed -i '/Url=*/'d $ccfg - sed -i '/Https=*/'d $ccfg - sed -i "6i\Https=\'$Https\'" $ccfg - #获取在线yaml文件 - $clashdir/start.sh getyaml - start_over - exit; - fi - clashlink - fi +if [ -n "$Https" -a -n "$test" ];then + echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + echo -e 请检查输入的链接是否正确: + echo -e "\033[4m$Https\033[0m" + read -p "确认导入配置文件?原配置文件将被更名为config.yaml.bak![1/0] > " res + if [ "$res" = '1' ]; then + #将用户链接写入mark + sed -i '/Url=*/'d $ccfg + sed -i '/Https=*/'d $ccfg + sed -i "6i\Https=\'$Https\'" $ccfg + #获取在线yaml文件 + $clashdir/start.sh getyaml + start_over + exit; + fi elif [[ $Https == 0 ]];then clashlink else echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - echo -e "\033[31m请输入正确的链接地址!!!\033[0m" + echo -e "\033[31m请输入正确的配置文件链接地址!!!\033[0m" + echo -e "\033[33m链接地址必须是http或者https开头的形式\033[0m" + clashlink fi } gettar(){ @@ -328,7 +326,7 @@ echo "(高级预览版) 内存占用更高" echo ----------------------------------------------- echo 0 返回上级菜单 read -p "请输入对应数字 > " num - if [ -z $num ]; then + if [ -z "$num" ]; then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" update @@ -518,7 +516,7 @@ echo -e " 3 Github源+clash代理(需开启clash服务)" echo -e " 4 自定义输入(请务必确保路径正确)" echo -e " 0 返回上级菜单" read -p "请输入对应数字 > " num -if [ -z $num ]; then +if [ -z "$num" ]; then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[31m请输入正确的数字!\033[0m" update diff --git a/scripts/start.sh b/scripts/start.sh index 86db39b..2fd2da8 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -27,12 +27,11 @@ source $ccfg getyaml(){ #前后端订阅服务器地址索引,可在此处添加! Server=`sed -n ""$server_link"p"<