v1.0.0beta14fix3

~修复部分ssr节点不可用的bug
~mac过滤功能增加移除单个设备以及添加全部设备功能
~修复设置本机代理时直接跳出的bug
~优化安装脚本,增加root用户检测
This commit is contained in:
juewuy
2020-10-11 21:30:20 +08:00
parent 156d9193ee
commit 87ae8b78be
14 changed files with 32 additions and 173 deletions

View File

@@ -2,7 +2,7 @@
# Copyright (C) Juewuy
echo='echo -e' && [ -n "$(ls -l /bin/sh|grep -o dash)" ] && echo=echo
test=1
[ -z "$1" ] && test=0 || test=$1
echo "***********************************************"
echo "** 欢迎使用 **"
@@ -10,18 +10,22 @@ echo "** ShellClash **"
echo "** by Juewuy **"
echo "***********************************************"
#检查root权限
[ "$USER" != "root" ] && echo 请使用root用户执行安装&& exit 1
#检查更新
url="https://cdn.jsdelivr.net/gh/juewuy/ShellClash"
if [ $test -ge 1 ];then
if [ "$test" -eq 1 ];then
url="--resolve raw.githubusercontent.com:443:199.232.68.133 https://raw.githubusercontent.com/juewuy/ShellClash/master"
[ $test -ge 2 ] && url="http://192.168.31.30:8080/clash-for-Miwifi"
[ $test -ge 3 ] && url="http://192.168.123.90:8080/clash-for-Miwifi"
[ "$test" -eq 2 ] && url="http://192.168.31.30:8080/clash-for-Miwifi"
[ "$test" -eq 3 ] && url="http://192.168.123.90:8080/clash-for-Miwifi"
else
release_new=$(curl -kfsSL --resolve api.github.com:443:140.82.113.5 "https://api.github.com/repos/juewuy/ShellClash/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g') #检查版本
fi
[ -z "$release_new" ] && release_new=$(curl -kfsSL $url/bin/version | grep "versionsh" | awk -F "=" '{print $2}')
[ -z "$release_new" ] && echo "无法连接服务器!" && exit
tarurl=$url@$release_new/bin/clashfm.tar.gz
[ $test -ge 1 ] && tarurl=$url/bin/clashfm.tar.gz
[ "$test" -eq 1 ] && tarurl=$url/bin/clashfm.tar.gz
gettar(){
result=$(curl -w %{http_code} -kLo /tmp/clashfm.tar.gz $tarurl)
[ "$result" != "200" ] && echo "文件下载失败!" && exit 1