mirror of
https://github.com/juewuy/ShellCrash.git
synced 2024-11-16 03:32:34 +08:00
v1.0.0beta2
~修复未开启ipv6的设备启动时报错的bug ~测试菜单部分功能优化 ~启动失败后的检查逻辑优化
This commit is contained in:
parent
b17200ae05
commit
6aa9077907
Binary file not shown.
|
@ -1,2 +1,2 @@
|
||||||
GeoIP_v=20200827
|
GeoIP_v=20200827
|
||||||
versionsh=1.0.0beta1
|
versionsh=1.0.0beta2
|
||||||
|
|
|
@ -110,13 +110,19 @@ clashstart(){
|
||||||
sleep 1
|
sleep 1
|
||||||
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh`
|
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh`
|
||||||
if [ -z "$status" ];then
|
if [ -z "$status" ];then
|
||||||
echo -e "\033[31mclash启动失败!尝试使用保守方式启动!\033[0m"
|
echo -e "\033[31mclash启动失败!\033[0m"
|
||||||
source $clashdir/start.sh && start_old
|
read -p "是否尝试使用保守方式启动?[1/0] > " res
|
||||||
sleep 1
|
if [ "$res" = '1' ]; then
|
||||||
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh`
|
source $clashdir/start.sh && start_old
|
||||||
if [ -z "$status" ];then
|
sleep 1
|
||||||
echo -e "\033[31mclash启动失败!\033[0m"
|
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh`
|
||||||
sed -i /start_old=*/d $ccfg
|
if [ -z "$status" ];then
|
||||||
|
echo -e "\033[31mclash启动失败!\033[0m"
|
||||||
|
sed -i /start_old=*/d $ccfg
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo -e "\033[33m操作取消!\033[0m"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -844,6 +850,7 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
echo -e "\033[30;47m这里是测试命令菜单\033[0m"
|
echo -e "\033[30;47m这里是测试命令菜单\033[0m"
|
||||||
echo -e "\033[33m如遇问题尽量运行相应命令后截图发群\033[0m"
|
echo -e "\033[33m如遇问题尽量运行相应命令后截图发群\033[0m"
|
||||||
|
echo -e "磁盘占用/所在目录:$(du -h $clashdir)"
|
||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
echo " 1 查看clash运行时的报错信息"
|
echo " 1 查看clash运行时的报错信息"
|
||||||
echo " 2 查看系统DNS端口(:53)占用 "
|
echo " 2 查看系统DNS端口(:53)占用 "
|
||||||
|
@ -861,15 +868,17 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
|
||||||
elif [[ $num == 0 ]]; then
|
elif [[ $num == 0 ]]; then
|
||||||
clashsh
|
clashsh
|
||||||
elif [[ $num == 1 ]]; then
|
elif [[ $num == 1 ]]; then
|
||||||
/etc/init.d/clash stop
|
clashstop
|
||||||
echo -e "\033[31m如有报错请截图后到TG群询问!!!\033[0m"
|
echo -----------------------------------------------
|
||||||
$clashdir/clash -d $clashdir & { sleep 3 ; kill $! & }
|
$clashdir/clash -d $clashdir & { sleep 3 ; kill $! & }
|
||||||
|
echo -----------------------------------------------
|
||||||
echo -e "\033[31m如有报错请截图后到TG群询问!!!\033[0m"
|
echo -e "\033[31m如有报错请截图后到TG群询问!!!\033[0m"
|
||||||
exit;
|
exit;
|
||||||
elif [[ $num == 2 ]]; then
|
elif [[ $num == 2 ]]; then
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
netstat -ntulp |grep 53
|
netstat -ntulp |grep 53
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
echo -e "可以使用\033[44m netstat -ntulp |grep xxx \033[0m来查询任意(xxx)端口"
|
||||||
exit;
|
exit;
|
||||||
elif [[ $num == 3 ]]; then
|
elif [[ $num == 3 ]]; then
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
|
@ -119,7 +119,9 @@ else
|
||||||
if [[ $status -gt 0 ]];then
|
if [[ $status -gt 0 ]];then
|
||||||
start_over
|
start_over
|
||||||
else
|
else
|
||||||
echo -e "\033[31mclash服务启动失败!尝试使用保守方式启动!\033[0m"
|
echo -e "\033[31mclash服务启动失败!\033[0m"
|
||||||
|
echo -e "\033[33m5秒后尝试使用保守方式启动!(使用ctrl+c退出!)\033[0m"
|
||||||
|
echo 5&&sleep 1&&echo 4&&sleep 1&&echo 3&&sleep 1&&echo 2&&sleep 1&&echo 1&&sleep 1
|
||||||
source $clashdir/start.sh && start_old
|
source $clashdir/start.sh && start_old
|
||||||
sleep 1
|
sleep 1
|
||||||
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh|wc -l`
|
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh|wc -l`
|
||||||
|
@ -218,7 +220,7 @@ echo -e "\033[33m当前过滤关键字:\033[47;30m$exclude\033[0m"
|
||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
echo -e "\033[36m匹配关键字的节点会在导入时被屏蔽\033[0m"
|
echo -e "\033[36m匹配关键字的节点会在导入时被屏蔽\033[0m"
|
||||||
echo -e "多个关键字可以用\033[30;47m | \033[0m号分隔"
|
echo -e "多个关键字可以用\033[30;47m | \033[0m号分隔"
|
||||||
echo -e "\033[32m支持正则表达式\033[0m,特殊符号请先用URLEncode转换"
|
echo -e "\033[32m支持正则表达式\033[0m,特殊符号请使用\033[30;47m \ \033[0m号转义"
|
||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
echo -e " 000 \033[31m删除\033[0m关键字"
|
echo -e " 000 \033[31m删除\033[0m关键字"
|
||||||
echo -e " 回车 取消输入并返回上级菜单"
|
echo -e " 回车 取消输入并返回上级菜单"
|
||||||
|
@ -231,9 +233,8 @@ elif [ "$exclude" = '000' ]; then
|
||||||
exclude=''
|
exclude=''
|
||||||
echo -e "\033[31m 已删除节点过滤关键字!!!\033[0m"
|
echo -e "\033[31m 已删除节点过滤关键字!!!\033[0m"
|
||||||
fi
|
fi
|
||||||
exclude=\'$exclude\'
|
|
||||||
sed -i '/exclude=*/'d $ccfg
|
sed -i '/exclude=*/'d $ccfg
|
||||||
sed -i "1i\exclude=$exclude" $ccfg
|
sed -i "1i\exclude=\'$exclude\'" $ccfg
|
||||||
linkset
|
linkset
|
||||||
}
|
}
|
||||||
linkset(){
|
linkset(){
|
||||||
|
@ -327,7 +328,8 @@ getlink2(){
|
||||||
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
echo -e "\033[30;47m 此功能不明勿用,出问题自行解决!\033[0m"
|
echo -e "\033[30;47m 此功能不明勿用,出问题自行解决!\033[0m"
|
||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
echo -e "\033[33m仅限导入完整clash链接!!!"
|
echo -e "\033[33m仅限导入完整clash链接!!!\033[0m"
|
||||||
|
echo -e "可以使用\033[32m https://acl4ssr.netlify.app \033[0m在线转换"
|
||||||
echo -e "\033[36m导入后如无法运行,请使用【导入节点/订阅链接】功能"
|
echo -e "\033[36m导入后如无法运行,请使用【导入节点/订阅链接】功能"
|
||||||
echo -e "\033[31m注意如节点使用了chacha20加密协议,需将核心更新为clashr核心\033[0m"
|
echo -e "\033[31m注意如节点使用了chacha20加密协议,需将核心更新为clashr核心\033[0m"
|
||||||
echo -----------------------------------------------
|
echo -----------------------------------------------
|
||||||
|
|
|
@ -125,7 +125,7 @@ stop_iptables(){
|
||||||
start_dns(){
|
start_dns(){
|
||||||
#允许tun网卡接受流量
|
#允许tun网卡接受流量
|
||||||
iptables -I FORWARD -o utun -j ACCEPT
|
iptables -I FORWARD -o utun -j ACCEPT
|
||||||
ip6tables -I FORWARD -o utun -j ACCEPT
|
ip6tables -I FORWARD -o utun -j ACCEPT > /dev/null 2>&1
|
||||||
#设置dns转发
|
#设置dns转发
|
||||||
iptables -t nat -N clash_dns
|
iptables -t nat -N clash_dns
|
||||||
for mac in $(cat $clashdir/mac); do
|
for mac in $(cat $clashdir/mac); do
|
||||||
|
@ -134,12 +134,12 @@ start_dns(){
|
||||||
iptables -t nat -A clash_dns -p udp --dport 53 -j REDIRECT --to 1053
|
iptables -t nat -A clash_dns -p udp --dport 53 -j REDIRECT --to 1053
|
||||||
iptables -t nat -A PREROUTING -p udp -j clash_dns
|
iptables -t nat -A PREROUTING -p udp -j clash_dns
|
||||||
#ipv6DNS
|
#ipv6DNS
|
||||||
ip6tables -t nat -N clash_dns
|
ip6tables -t nat -N clash_dns > /dev/null 2>&1
|
||||||
for mac in $(cat $clashdir/mac); do
|
for mac in $(cat $clashdir/mac); do
|
||||||
ip6tables -t nat -A clash_dns -m mac --mac-source $mac -j RETURN
|
ip6tables -t nat -A clash_dns -m mac --mac-source $mac -j RETURN > /dev/null 2>&1
|
||||||
done
|
done
|
||||||
ip6tables -t nat -A clash_dns -p udp --dport 53 -j REDIRECT --to 1053
|
ip6tables -t nat -A clash_dns -p udp --dport 53 -j REDIRECT --to 1053 > /dev/null 2>&1
|
||||||
ip6tables -t nat -A PREROUTING -p udp -j clash_dns
|
ip6tables -t nat -A PREROUTING -p udp -j clash_dns > /dev/null 2>&1
|
||||||
}
|
}
|
||||||
daemon_old(){
|
daemon_old(){
|
||||||
#守护进程状态
|
#守护进程状态
|
||||||
|
|
Loading…
Reference in New Issue
Block a user