diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index 21a31e4..ac50651 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/bin/version b/bin/version index 5b0cb5a..b0a5886 100644 --- a/bin/version +++ b/bin/version @@ -1,2 +1,2 @@ GeoIP_v=20200817 -versionsh=0.9.5 +versionsh=0.9.6 diff --git a/scripts/clash.sh b/scripts/clash.sh index 3bdbadd..724107d 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -14,7 +14,7 @@ fi ccfg=$clashdir/mark yaml=$clashdir/config.yaml #检查标识文件 -if [ ! -f "$ccfg" ]; then +if [ ! -f $ccfg ]; then echo mark文件不存在,正在创建! cat >$ccfg< " num @@ -406,7 +398,6 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then echo -e "\033[33m已设为开启跳过本地证书验证!!\033[0m" skip_cert=已开启 else - /etc/init.d/clash enable sed -i "1i\skip_cert=未开启" $ccfg echo -e "\033[33m已设为禁止跳过本地证书验证!!\033[0m" skip_cert=未开启 @@ -421,7 +412,6 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then echo -e "\033[33m已设为仅代理(22,53,587,465,995,993,143,80,443)等常用端口!!\033[0m" common_ports=已开启 else - /etc/init.d/clash enable sed -i "1i\common_ports=未开启" $ccfg echo -e "\033[33m已设为代理全部端口!!\033[0m" common_ports=未开启 @@ -438,7 +428,6 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then echo -e "\033[33m!!!必然会导致上不了网!!!\033[0m" modify_yaml=已开启 else - /etc/init.d/clash enable sed -i "1i\modify_yaml=未开启" $ccfg echo -e "\033[32m已设为使用脚本内置规则管理config.yaml配置文件!!\033[0m" modify_yaml=未开启 @@ -454,7 +443,6 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then echo -e "Clash对ipv6的支持并不友好,如不能使用请静等修复!" ipv6_support=已开启 else - /etc/init.d/clash enable sed -i "1i\ipv6_support=未开启" $ccfg echo -e "\033[32m已禁用对ipv6协议的支持!!\033[0m" ipv6_support=未开启 @@ -524,16 +512,27 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then clashadv fi - + elif [[ $num == 8 ]]; then + sed -i '/dns_over*/'d $ccfg + echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + if [ "$dns_over" = "未开启" ] > /dev/null 2>&1; then + sed -i "1i\dns_over=已开启" $ccfg + echo -e "\033[33m已设置DNS为不走本地dnsmasq服务器!\033[0m" + echo -e "可能会对浏览速度产生一定影响,介意勿用!" + dns_over=已开启 + else + /etc/init.d/clash enable + sed -i "1i\dns_over=未开启" $ccfg + echo -e "\033[32m已设置DNS通过本地dnsmasq服务器!\033[0m" + echo -e "redir-host模式下部分网站可能会被运营商dns污染导致无法打开" + dns_over=未开启 + fi + clashadv clashadv elif [[ $num == 9 ]]; then - if [ $status -gt 0 ];then - echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - /etc/init.d/clash stop - echo -e "\033[31mClash服务已停止!\033[0m" - fi + [ $status -gt 0 ] && /etc/init.d/clash stop clashstart clashsh else diff --git a/scripts/clashservice b/scripts/clashservice index 981f83c..d6d1ff7 100644 --- a/scripts/clashservice +++ b/scripts/clashservice @@ -16,23 +16,16 @@ cat >$ccfg< " url test=$(echo $url | grep "://") @@ -440,6 +440,10 @@ if [ "$res" = '1' ]; then getdb else echo -e "\033[33m下载成功,正在解压文件!\033[0m" + if cat /proc/mounts | grep -q www ;then + echo 检测到/www为只读,正在重新挂载! + mount -o remount -rw /www + fi mkdir -p /www/clash > /dev/null tar -zxvf '/tmp/clashdb.tar.gz' -C /www/clash > /dev/null [ $? -ne 0 ] && echo "文件解压失败!" && exit 1