mirror of
https://github.com/juewuy/ShellCrash.git
synced 2024-11-16 19:55:57 +08:00
v1.3.9-test
~本机代理相关逻辑优化及bug修复 ~本机代理功能增加对保守模式的支持 ~绕过内核功能增加ipset模块检测 ~增加对低版本wget命令的支持 ~增加了使用内核保存节点列表的逻辑
This commit is contained in:
parent
97cb5479b1
commit
d7dd915472
Binary file not shown.
|
@ -28,10 +28,15 @@ webget(){
|
||||||
[ -z "$4" ] && redirect='-L' || redirect=''
|
[ -z "$4" ] && redirect='-L' || redirect=''
|
||||||
result=$(curl -w %{http_code} --connect-timeout 5 $progress $redirect -ko $1 $2)
|
result=$(curl -w %{http_code} --connect-timeout 5 $progress $redirect -ko $1 $2)
|
||||||
else
|
else
|
||||||
|
if wget --version > /dev/null 2>&1;then
|
||||||
[ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress'
|
[ "$3" = "echooff" ] && progress='-q' || progress='-q --show-progress'
|
||||||
|
[ "$4" = "rediroff" ] && redirect='--max-redirect=0' || redirect=''
|
||||||
|
certificate='--no-check-certificate'
|
||||||
|
timeout='--timeout=3'
|
||||||
|
fi
|
||||||
[ "$3" = "echoon" ] && progress=''
|
[ "$3" = "echoon" ] && progress=''
|
||||||
[ -z "$4" ] && redirect='' || redirect='--max-redirect=0'
|
[ "$3" = "echooff" ] && progress='-q'
|
||||||
wget -Y on $progress $redirect --no-check-certificate --timeout=5 -O $1 $2
|
wget $progress $redirect $certificate $timeout -O $1 $2
|
||||||
[ $? -eq 0 ] && result="200"
|
[ $? -eq 0 ] && result="200"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -489,18 +489,19 @@ localproxy(){
|
||||||
localproxy
|
localproxy
|
||||||
else
|
else
|
||||||
local_proxy=已开启
|
local_proxy=已开启
|
||||||
$clashdir/start.sh set_proxy $mix_port $db_port
|
setconfig local_proxy $local_proxy
|
||||||
echo -e "\033[32m已经成功使用$local_type方式配置本机代理~\033[0m"
|
echo -e "\033[32m已经成功使用$local_type方式配置本机代理~\033[0m"
|
||||||
[ "$local_type" = "环境变量" ] && echo -e "\033[36m如未生效,请重新启动终端或重新连接SSH!\033[0m" && sleep 1
|
[ "$local_type" = "环境变量" ] && $clashdir/start.sh set_proxy $mix_port $db_port &&echo -e "\033[36m如未生效,请重新启动终端或重新连接SSH!\033[0m" && sleep 1
|
||||||
[ "$local_type" = "iptables增强模式" ] && $clashdir/start.sh start
|
[ "$local_type" = "iptables增强模式" ] && $clashdir/start.sh start
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
local_proxy=未开启
|
local_proxy=未开启
|
||||||
|
setconfig local_proxy $local_proxy
|
||||||
$clashdir/start.sh stop
|
$clashdir/start.sh stop
|
||||||
echo -e "\033[33m已经停用本机代理规则并停止clash服务!!\033[0m"
|
echo -e "\033[33m已经停用本机代理规则并停止clash服务!!\033[0m"
|
||||||
[ "$local_type" = "环境变量" ] && echo -e "\033[36m如未生效,请重新启动终端或重新连接SSH!\033[0m" && sleep 1
|
[ "$local_type" = "环境变量" ] && echo -e "\033[36m如未生效,请重新启动终端或重新连接SSH!\033[0m" && sleep 1
|
||||||
fi
|
fi
|
||||||
setconfig local_proxy $local_proxy
|
|
||||||
elif [ "$num" = 2 ]; then
|
elif [ "$num" = 2 ]; then
|
||||||
local_type="环境变量"
|
local_type="环境变量"
|
||||||
setconfig local_type $local_type
|
setconfig local_type $local_type
|
||||||
|
|
|
@ -683,6 +683,7 @@ afstart(){
|
||||||
[ "$redir_mod" != "纯净模式" ] && [ "$dns_no" != "已禁用" ] && start_dns
|
[ "$redir_mod" != "纯净模式" ] && [ "$dns_no" != "已禁用" ] && start_dns
|
||||||
[ "$redir_mod" != "纯净模式" ] && [ "$redir_mod" != "Tun模式" ] && start_redir
|
[ "$redir_mod" != "纯净模式" ] && [ "$redir_mod" != "Tun模式" ] && start_redir
|
||||||
[ "$redir_mod" = "Redir模式" ] && [ "$tproxy_mod" = "已开启" ] && start_udp
|
[ "$redir_mod" = "Redir模式" ] && [ "$tproxy_mod" = "已开启" ] && start_udp
|
||||||
|
[ "$local_proxy" = "已开启" ] && [ "$local_type" = "iptables增强模式" ] && start_output
|
||||||
#标记启动时间
|
#标记启动时间
|
||||||
mark_time
|
mark_time
|
||||||
#设置本机代理
|
#设置本机代理
|
||||||
|
|
Loading…
Reference in New Issue
Block a user