~新增CDN下载源和Github下载源,下载更新速度更快
~新增了切换下载源的选项菜单
~界面UI优化及bug修复
This commit is contained in:
juewuy
2020-08-10 20:24:28 +08:00
parent 022cd07935
commit 31865ff734
5 changed files with 200 additions and 147 deletions

View File

@@ -11,17 +11,17 @@ url="https://juewuy.xyz/clash"
result=$(curl -w %{http_code} -skLo /tmp/clashversion $url/bin/version)
[ "$result" != "200" ] && echo "无法连接到服务器!" && exit 1
source /tmp/clashversion
echo -----------------------------------------------
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "~~~~版本:\033[32m$versionsh\033[0m"
echo -----------------------------------------------
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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[32m 1 在默认目录(/etc)安装Clash for Miwifi"
echo -e "\033[33m 2 手动设置安装目录(不明勿用!)"
echo -e "\033[0m 0 退出安装"
echo -----------------------------------------------
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
read -p "请输入相应数字 > " num
if [ -z $num ];then
@@ -30,7 +30,7 @@ if [ -z $num ];then
elif [[ $num == 1 ]];then
dir=/etc
elif [[ $num == 2 ]];then
echo -----------------------------------------------
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo '可用路径 剩余空间:'
df -h | awk '{print $6,$2}'| sed 1d
echo '路径是必须带 / 的格式,写入虚拟内存(/tmp,/sys,..)的文件会在重启后消失!!!'
@@ -44,9 +44,9 @@ else
exit;
fi
#下载文件包
echo -----------------------------------------------
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo 开始从服务器获取安装文件!
echo -----------------------------------------------
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tarurl=$url/bin/clashfm.tar.gz
if command -v curl &> /dev/null; then
result=$(curl -w %{http_code} -kLo /tmp/clashfm.tar.gz $tarurl)
@@ -56,7 +56,7 @@ else $result
fi
[ "$result" != "200" ] && echo "文件下载失败!" && exit 1
#解压
echo -----------------------------------------------
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo 开始解压文件!
mkdir -p $dir/clash > /dev/null
tar -zxvf '/tmp/clashfm.tar.gz' -C $dir/clash/ > /dev/null
@@ -80,8 +80,8 @@ echo "export clashdir=\"$dir/clash\"" >> /etc/profile #设置clash路径环境
#删除临时文件
rm -rf /tmp/clashfm.tar.gz
#提示
echo -----------------------------------------------
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo clash for Miwifi 已经安装成功!
echo -e "\033[33m直接输入\033[30;47m clash \033[0;33m命令即可管理\033[0m"
echo -----------------------------------------------
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~