v1.0.0beta2

~修复未开启ipv6的设备启动时报错的bug
~测试菜单部分功能优化
~启动失败后的检查逻辑优化
This commit is contained in:
juewuy 2020-08-29 16:09:52 +08:00
parent b17200ae05
commit 6aa9077907
5 changed files with 31 additions and 20 deletions

Binary file not shown.

View File

@ -1,2 +1,2 @@
GeoIP_v=20200827
versionsh=1.0.0beta1
versionsh=1.0.0beta2

View File

@ -110,13 +110,19 @@ clashstart(){
sleep 1
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh`
if [ -z "$status" ];then
echo -e "\033[31mclash启动失败尝试使用保守方式启动\033[0m"
source $clashdir/start.sh && start_old
sleep 1
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh`
if [ -z "$status" ];then
echo -e "\033[31mclash启动失败\033[0m"
sed -i /start_old=*/d $ccfg
echo -e "\033[31mclash启动失败\033[0m"
read -p "是否尝试使用保守方式启动?[1/0] > " res
if [ "$res" = '1' ]; then
source $clashdir/start.sh && start_old
sleep 1
status=`ps |grep -w 'clash'|grep -v grep|grep -v clash.sh`
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
fi
fi
@ -844,6 +850,7 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[30;47m这里是测试命令菜单\033[0m"
echo -e "\033[33m如遇问题尽量运行相应命令后截图发群\033[0m"
echo -e "磁盘占用/所在目录:$(du -h $clashdir)"
echo -----------------------------------------------
echo " 1 查看clash运行时的报错信息"
echo " 2 查看系统DNS端口(:53)占用 "
@ -861,15 +868,17 @@ if [[ $num -le 9 ]] > /dev/null 2>&1; then
elif [[ $num == 0 ]]; then
clashsh
elif [[ $num == 1 ]]; then
/etc/init.d/clash stop
echo -e "\033[31m如有报错请截图后到TG群询问\033[0m"
clashstop
echo -----------------------------------------------
$clashdir/clash -d $clashdir & { sleep 3 ; kill $! & }
echo -----------------------------------------------
echo -e "\033[31m如有报错请截图后到TG群询问\033[0m"
exit;
elif [[ $num == 2 ]]; then
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
netstat -ntulp |grep 53
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "可以使用\033[44m netstat -ntulp |grep xxx \033[0m来查询任意(xxx)端口"
exit;
elif [[ $num == 3 ]]; then
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -119,7 +119,9 @@ else
if [[ $status -gt 0 ]];then
start_over
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
sleep 1
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 -e "\033[36m匹配关键字的节点会在导入时被屏蔽\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 -e " 000 \033[31m删除\033[0m关键字"
echo -e " 回车 取消输入并返回上级菜单"
@ -231,9 +233,8 @@ elif [ "$exclude" = '000' ]; then
exclude=''
echo -e "\033[31m 已删除节点过滤关键字!!!\033[0m"
fi
exclude=\'$exclude\'
sed -i '/exclude=*/'d $ccfg
sed -i "1i\exclude=$exclude" $ccfg
sed -i "1i\exclude=\'$exclude\'" $ccfg
linkset
}
linkset(){
@ -327,7 +328,8 @@ getlink2(){
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo -e "\033[30;47m 此功能不明勿用,出问题自行解决!\033[0m"
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[31m注意如节点使用了chacha20加密协议需将核心更新为clashr核心\033[0m"
echo -----------------------------------------------

View File

@ -125,7 +125,7 @@ stop_iptables(){
start_dns(){
#允许tun网卡接受流量
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转发
iptables -t nat -N clash_dns
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 PREROUTING -p udp -j clash_dns
#ipv6DNS
ip6tables -t nat -N clash_dns
ip6tables -t nat -N clash_dns > /dev/null 2>&1
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
ip6tables -t nat -A clash_dns -p udp --dport 53 -j REDIRECT --to 1053
ip6tables -t nat -A PREROUTING -p udp -j clash_dns
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 > /dev/null 2>&1
}
daemon_old(){
#守护进程状态