diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index e24cdf0..c04c0c1 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/scripts/clash.sh b/scripts/clash.sh index 5842f97..7f9ea00 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -106,6 +106,13 @@ clashstart(){ echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if [ "$start_old" = "已开启" ];then source $clashdir/start.sh && start_old + sleep 1 + status=`ps |grep -w 'clash -d'|grep -v grep` + if [ -z "$status" ];then + echo -e "\033[31mclash启动失败!\033[0m" + sed -i /start_old=*/d $ccfg + exit + fi else /etc/init.d/clash start sleep 1 @@ -113,15 +120,16 @@ clashstart(){ if [ -z "$status" ];then echo -e "\033[31mclash启动失败!尝试使用保守方式启动!\033[0m" source $clashdir/start.sh && start_old + sleep 1 + status=`ps |grep -w 'clash -d'|grep -v grep` + if [ -z "$status" ];then + echo -e "\033[31mclash启动失败!\033[0m" + sed -i /start_old=*/d $ccfg + exit + fi fi fi - sleep 1 - status=`ps |grep -w 'clash -d'|grep -v grep` - if [ -z "$status" ];then - echo -e "\033[31mclash启动失败!\033[0m" - sed -i /start_old=*/d $ccfg - exit - fi + 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 "\033[32mclash服务已启动!\033[0m" echo -e "可以使用\033[30;47m http://clash.razord.top \033[0m管理内置规则" @@ -561,9 +569,9 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if [ "$modify_yaml" = "未开启" ] > /dev/null 2>&1; then sed -i "1i\modify_yaml=已开启" $ccfg - echo -e "\033[33m已设为使用用户完成自定义配置文件!!" - echo -e "\033[0m不明白原理的用户切勿随意开启此选项" - echo -e "\033[33m!!!必然会导致上不了网!!!\033[0m" + echo -e "\033[33m已设为使用用户完全自定义的配置文件!!" + echo -e "\033[36m不明白原理的用户切勿随意开启此选项" + echo -e "\033[31m!!!必然会导致上不了网!!!\033[0m" modify_yaml=已开启 sleep 3 else @@ -613,7 +621,7 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then clashsh else echo -e "\033[31m暂未支持的选项!\033[0m" - clashadv + clashsh fi else echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 03d1835..e790217 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -94,18 +94,32 @@ else mv $yamlnew $yaml echo 配置文件已生成!正在启动clash使其生效! #重启clash服务 - /etc/init.d/clash stop > /dev/null 2>&1 - /etc/init.d/clash start + if [ $status -gt 0 ];then + echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + killall -9 clash &> /dev/null + echo -e "\033[31mClash服务已停止!\033[0m" + fi + echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if [ "$start_old" = "已开启" ];then + source $clashdir/start.sh && start_old + else + /etc/init.d/clash start + sleep 1 + status=`ps |grep -w 'clash -d'|grep -v grep` + if [ -z "$status" ];then + echo -e "\033[31mclash启动失败!尝试使用保守方式启动!\033[0m" + source $clashdir/start.sh && start_old + fi + fi sleep 1 status=`ps |grep -w 'clash -d'|grep -v grep|wc -l` if [[ $status -gt 0 ]];then 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ echo -e "\033[32mclash服务已启动!\033[0m" echo -e "可以使用\033[30;47m http://clash.razord.top \033[0m管理内置规则" echo -e "Host地址:\033[36m $host \033[0m 端口:\033[36m 9999 \033[0m" echo -e "也可前往更新菜单安装本地Dashboard面板,连接更稳定!\033[0m" - sleep 1 + echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ clashsh else echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/scripts/start.sh b/scripts/start.sh index 2168144..00738e8 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -70,7 +70,8 @@ exper='experimental: {ignore-resolve-fail: true, interface-name: en0}' sed -i "10a$exper" $clashdir/config.yaml #跳过本地tls证书验证 if [ "$skip_cert" != "未开启" ];then - sed -i "10,99s/sni: */\1skip-cert-verify: true}/" $clashdir/config.yaml #跳过trojan本地证书验证 + #sed -i '10,99s/sni: \S*}/\1skip-cert-verify: true}/' $clashdir/config.yaml #跳过trojan本地证书验证 + sed -i '10,99s/sni: .*}/\1skip-cert-verify: true}/' $clashdir/config.yaml #跳过trojan本地证书验证 sed -i '10,99s/}}/}, skip-cert-verify: true}/' $clashdir/config.yaml #跳过v2+ssl本地证书验证 fi }