~紧急更新修复部分用户无法获取dns的bug
This commit is contained in:
juewuy
2020-08-07 17:03:11 +08:00
parent 3c221ca26d
commit 119f34894a
5 changed files with 29 additions and 16 deletions

View File

@@ -8,14 +8,19 @@ echo "** by Juewuy **"
echo "***********************************************"
url="https://juewuy.xyz/clash"
echo -e "\033[44m 使用中如遇问题请加TG群反馈\033[42;30m t.me/clashfm \033[0m"
echo -e "\033[37m 目前仅支持小米AX系列3款路由器"
echo -e "\033[44m 其余型号可到TG群报名参与测试\033[0m"
result=$(curl -w %{http_code} -skLo /tmp/clashversion $url/bin/version)
[ "$result" != "200" ] && echo "无法连接到服务器!" && exit 1
source /tmp/clashversion
echo -----------------------------------------------
echo -e "\033[32m1 在默认目录(/etc)安装Clash for Miwifi"
echo -e "\033[33m2 手动设置安装目录(小白慎用!)"
echo -e "\033[0m0 退出安装"
echo -e "最新版本为:\033[32m $versionsh \033[0m"
echo -----------------------------------------------
echo -e "\033[44m使用中如遇问题请加TG群反馈\033[42;30m t.me/clashfm \033[0m"
echo -e "\033[37m目前仅支持小米AX系列3款路由器"
echo -e "\033[44m其余型号可到TG群报名参与测试\033[0m"
echo -----------------------------------------------
echo -e "\033[32m 1 在默认目录(/etc)安装Clash for Miwifi"
echo -e "\033[33m 2 手动设置安装目录(不明勿用!)"
echo -e "\033[0m 0 退出安装"
echo -----------------------------------------------
read -p "请输入相应数字 > " num
@@ -41,9 +46,9 @@ fi
#下载文件包
echo -----------------------------------------------
echo 开始从服务器获取安装文件!
echo -----------------------------------------------
tarurl=$url/bin/clashfm.tar.gz
if command -v curl &> /dev/null; then
echo 没有好的服务器,下载慢或者没速度请见谅!!!
result=$(curl -w %{http_code} -kLo /tmp/clashfm.tar.gz $tarurl)
else $result
wget-ssl -q --no-check-certificate --tries=1 --timeout=10 -O /tmp/clashfm.tar.gz $tarurl
@@ -60,7 +65,13 @@ tar -zxvf '/tmp/clashfm.tar.gz' -C $dir/clash/ > /dev/null
mv $dir/clash/clashservice /etc/init.d/clash #将clash服务文件移动到系统目录
chmod 777 $dir/clash/clash #授予权限
chmod 777 /etc/init.d/clash #授予权限
if [ ! -f "$dir/clash/mark" ]; then
cat >$ccfg<<EOF
#标识clash运行状态的文件不明勿动
EOF
fi
sed -i '/versionsh_l=*/'d $dir/clash/mark
sed -i "1i\versionsh_l=$versionsh" $dir/clash/mark
#设置环境变量
sed -i '/alias clash=*/'d /etc/profile
echo "alias clash=\"sh $dir/clash/clash.sh\"" >> /etc/profile #设置快捷命令环境变量