v1.0.0beta10fix1
~增加大量订阅内置规则 ~修复偶尔无法正常更新的bug ~修复导入订阅时无法正常启动的bug ~修复ac2100核心无法正常工作的bug
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -10,7 +10,7 @@ else
|
||||
[ -z $host ] && host=127.0.0.1
|
||||
fi
|
||||
#服务器地址
|
||||
[ -z "$update_url" ] && update_url=https://cdn.jsdelivr.net/gh/juewuy/ShellClash
|
||||
[ -z "$update_url" ] && update_url=https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master
|
||||
#文件路径
|
||||
[ -z "$clashdir" ] && clashdir=$(dirname $(readlink -f "$0")) && echo "export clashdir=\"$clashdir\"" >> /etc/profile
|
||||
ccfg=$clashdir/mark
|
||||
@@ -132,13 +132,11 @@ clashstart(){
|
||||
clashlink(){
|
||||
#获取订阅规则
|
||||
if [ -z "$rule_link" ]; then
|
||||
sed -i '/rule_link=*/'d $ccfg
|
||||
sed -i "4i\rule_link=1" $ccfg
|
||||
rule_link=1
|
||||
fi
|
||||
#获取后端服务器地址
|
||||
if [ -z "$server_link" ]; then
|
||||
sed -i '/server_link=*/'d $ccfg
|
||||
sed -i "5i\server_link=1" $ccfg
|
||||
server_link=1
|
||||
fi
|
||||
@@ -146,7 +144,7 @@ echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[30;47m 欢迎使用订阅功能!\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e " 1 导入\033[36m节点/订阅\033[0m链接"
|
||||
echo -e " 2 使用完整clash规则链接"
|
||||
echo -e " 2 导入完整clash链接"
|
||||
echo -e " 3 添加/修改\033[32m节点过滤\033[0m关键字 \033[47;30m$exclude\033[0m"
|
||||
echo -e " 4 选取\033[33mclash配置规则\033[0m模版"
|
||||
echo -e " 5 选择在线生成服务器"
|
||||
@@ -239,8 +237,9 @@ elif [[ $num == 7 ]];then
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
read -p "确认更新配置文件?[1/0] > " res
|
||||
if [ "$res" = '1' ]; then
|
||||
source $clashdir/start.sh
|
||||
getyaml
|
||||
$clashdir/start.sh getyaml
|
||||
start_over
|
||||
exit;
|
||||
fi
|
||||
clashlink
|
||||
fi
|
||||
@@ -636,10 +635,10 @@ if [ -z "$release_new" ];then
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[33m正在检查更新!\033[0m"
|
||||
if [ "$update_url" = "https://cdn.jsdelivr.net/gh/juewuy/ShellClash" ];then
|
||||
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')
|
||||
release_new=$(curl -kfsSL --resolve api.github.com:443:140.82.113.5 --connect-timeout 3 -m 3 "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')
|
||||
update_url=$update_url@$release_new
|
||||
fi
|
||||
[ -z "$release_new" ] && release_new=$(curl -kfsSL $update_url/bin/version | grep "versionsh" | awk -F "=" '{print $2}')
|
||||
[ -z "$release_new" ] && release_new=$(curl -kfsSL --connect-timeout 3 -m 3 $update_url/bin/version | grep "versionsh" | awk -F "=" '{print $2}')
|
||||
[ -z "$release_new" ] && echo "检查更新失败!"
|
||||
fi
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -5,24 +5,28 @@ linkconfig(){
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[44m 实验性功能,遇问题请加TG群反馈:\033[42;30m t.me/clashfm \033[0m"
|
||||
echo 当前使用规则为:$rule_link
|
||||
echo 1 ACL4SSR默认通用版
|
||||
echo 2 ACL4SSR精简全能版(推荐)
|
||||
echo 3 ACL4SSR通用版+去广告加强
|
||||
echo 4 ACL4SSR精简版+去广告加强
|
||||
echo 5 ACL4SSR通用版无去广告
|
||||
echo 6 ACL4SSR通用版无自动测速
|
||||
echo 7 ACL4SSR精简版无自动测速
|
||||
echo 8 ACL4SSR全分组+奈飞(慎用)
|
||||
echo 9 ACL4SSR全分组+去广告(慎用)
|
||||
echo 1 ACL4SSR通用版无去广告(推荐)
|
||||
echo 2 ACL4SSR精简全能版(推荐)
|
||||
echo 3 ACL4SSR通用版+去广告加强
|
||||
echo 4 ACL4SSR精简版+去广告加强
|
||||
echo 5 ACL4SSR重度全分组+奈飞分流
|
||||
echo 6 ACL4SSR重度全分组+去广告加强
|
||||
echo 7 洞主规则精简版(推荐)
|
||||
echo 8 洞主规则重度完整版
|
||||
echo 9 神机规则高级版
|
||||
echo 10 神机规则-回国专用
|
||||
echo 11 李哥规则-墙洞专用
|
||||
echo 12 基础规则-仅Geoip CN+Final
|
||||
echo 13 网易云解锁-仅规则分组
|
||||
echo -----------------------------------------------
|
||||
echo 0 返回上级菜单
|
||||
read -p "请输入对应数字 > " num
|
||||
if [ -z "$num" ] || [[ $num -gt 9 ]];then
|
||||
if [ -z "$num" ] || [[ $num -gt 13 ]];then
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[31m请输入正确的数字!\033[0m"
|
||||
elif [[ "$num" = 0 ]];then
|
||||
echo
|
||||
elif [[ $num -le 9 ]];then
|
||||
elif [[ $num -le 13 ]];then
|
||||
#将对应标记值写入mark
|
||||
sed -i '/rule_link*/'d $ccfg
|
||||
sed -i "4i\rule_link="$num"" $ccfg
|
||||
@@ -110,8 +114,9 @@ if [ -n $Url ];then
|
||||
sed -i "6i\Url=\'$Url\'" $ccfg
|
||||
Https=""
|
||||
#获取在线yaml文件
|
||||
source $clashdir/start.sh
|
||||
getyaml
|
||||
$clashdir/start.sh getyaml
|
||||
start_over
|
||||
exit;
|
||||
elif [ "$num" = '2' ]; then
|
||||
linkfilter
|
||||
linkset
|
||||
@@ -190,7 +195,7 @@ clashlink
|
||||
}
|
||||
getlink2(){
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[30;47m 此功能不明勿用,出问题自行解决!\033[0m"
|
||||
echo -e "\033[30;47m 此功能不明勿用!\033[0m"
|
||||
echo -----------------------------------------------
|
||||
echo -e "\033[33m仅限导入完整clash链接!!!\033[0m"
|
||||
echo -e "可以使用\033[32m https://acl4ssr.netlify.app \033[0m在线转换"
|
||||
@@ -215,6 +220,8 @@ if [ -n $Https ];then
|
||||
sed -i "6i\Https=\'$Https\'" $ccfg
|
||||
#获取在线yaml文件
|
||||
$clashdir/start.sh getyaml
|
||||
start_over
|
||||
exit;
|
||||
fi
|
||||
clashlink
|
||||
fi
|
||||
@@ -540,7 +547,7 @@ if [ -z $num ]; then
|
||||
elif [[ $num == 1 ]]; then
|
||||
update_url='--resolve raw.githubusercontent.com:443:199.232.68.133 https://raw.githubusercontent.com/juewuy/ShellClash/master'
|
||||
elif [[ $num == 2 ]]; then
|
||||
update_url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash'
|
||||
update_url='https://cdn.jsdelivr.net/gh/juewuy/ShellClash@master'
|
||||
elif [[ $num == 3 ]]; then
|
||||
update_url='-x 127.0.0.1:7890 https://raw.githubusercontent.com/juewuy/ShellClash/master'
|
||||
elif [[ $num == 4 ]]; then
|
||||
|
||||
@@ -35,15 +35,19 @@ api.wcc.best
|
||||
skapi.cool
|
||||
EOF`
|
||||
Config=`sed -n ""$rule_link"p"<<EOF
|
||||
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online.ini
|
||||
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoReject.ini
|
||||
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_MultiMode.ini
|
||||
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_AdblockPlus.ini
|
||||
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_AdblockPlus.ini
|
||||
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoReject.ini
|
||||
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoAuto.ini
|
||||
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_NoAuto.ini
|
||||
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_Netflix.ini
|
||||
https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_AdblockPlus.ini
|
||||
https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/lhie1_clash.ini
|
||||
https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/lhie1_dler.ini
|
||||
https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/connershua_pro.ini
|
||||
https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/connershua_backtocn.ini
|
||||
https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/dlercloud_lige_platinum.ini
|
||||
https://subconverter.oss-ap-southeast-1.aliyuncs.com/Rules/RemoteConfig/special/basic.ini
|
||||
https://subconverter.oss-ap-southeast-1.aliyuncs.com/Rules/RemoteConfig/special/netease.ini
|
||||
EOF`
|
||||
#如果传来的是Url链接则合成Https链接,否则直接使用Https链接
|
||||
if [ -z $Https ];then
|
||||
@@ -105,8 +109,7 @@ else
|
||||
if cat $yamlnew | grep 'cipher: chacha20,' >/dev/null;then
|
||||
if [ "$clashcore" = "clash" -o "$clashcore" = "clashpre" ];then
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[31m当前核心:$clashcore不支持chacha20加密!!!\033[0m"
|
||||
echo -e "请更换使用clashR核心!!!"
|
||||
echo -e "\033[31m不支持chacha20加密,请更换节点加密协议!!!\033[0m"
|
||||
sleep 2
|
||||
getcore
|
||||
fi
|
||||
@@ -119,9 +122,7 @@ else
|
||||
$0 stop
|
||||
$0 start
|
||||
sleep 1
|
||||
if pidof clash >/dev/null;then
|
||||
start_over
|
||||
else
|
||||
if [ -z $(pidof clash) ];then
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if [ -f $yaml.bak ];then
|
||||
$clashdir/start.sh stop
|
||||
@@ -129,10 +130,7 @@ else
|
||||
$0 start
|
||||
echo -e "\033[31mclash服务启动失败!已还原配置文件并重启clash!\033[0m"
|
||||
sleep 1
|
||||
if pidof clash >/dev/null;then
|
||||
start_over
|
||||
exit;
|
||||
fi
|
||||
[ -n $(pidof clash) ] && exit;
|
||||
fi
|
||||
echo -e "\033[31mclash服务启动失败!请查看报错信息!\033[0m"
|
||||
$0 stop
|
||||
@@ -147,10 +145,9 @@ else
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
echo -e "\033[33m请检查如上配置文件信息:\033[0m"
|
||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
exit;
|
||||
fi
|
||||
#exit;
|
||||
fi
|
||||
#exit
|
||||
}
|
||||
modify_yaml(){
|
||||
##########需要变更的配置###########
|
||||
|
||||
Reference in New Issue
Block a user