mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-10 23:41:22 +00:00
~bug fix
This commit is contained in:
@@ -304,7 +304,7 @@ set_fw_filter(){ #流量过滤
|
||||
;;
|
||||
1)
|
||||
echo "-----------------------------------------------"
|
||||
if [ -n "$(pidof CrashCore)" ]; then
|
||||
if [ -n "$(pidof CrashCore)" ] && [ "$firewall_mod" = 'iptables' ]; then
|
||||
read -p "切换时将停止服务,是否继续?(1/0) > " res
|
||||
[ "$res" = 1 ] && "$CRASHDIR"/start.sh stop && set_common_ports
|
||||
else
|
||||
|
||||
@@ -372,16 +372,16 @@ EOF
|
||||
}
|
||||
}
|
||||
if [ -z "$(grep "provider_temp_${coretype}" "$CRASHDIR"/configs/ShellCrash.cfg)" ];then
|
||||
provider_temp_file=$(sed -n "1 p" "$CRASHDIR"/configs/${coretype}_providers.list | awk '{print $2}')
|
||||
provider_temp_file="$TMPDIR/$(sed -n "1 p" "$CRASHDIR"/configs/${coretype}_providers.list | awk '{print $2}')"
|
||||
else
|
||||
provider_temp_file=$(grep "provider_temp_${coretype}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
|
||||
fi
|
||||
echo "-----------------------------------------------"
|
||||
if [ -s ${provider_temp_file} ];then
|
||||
ln -sf ${provider_temp_file} "$TMPDIR"/provider_temp_file
|
||||
if [ -s "$provider_temp_file" ];then
|
||||
ln -sf "$provider_temp_file" "$TMPDIR"/provider_temp_file
|
||||
else
|
||||
echo -e "\033[33m正在获取在线模版!\033[0m"
|
||||
get_bin "$TMPDIR"/provider_temp_file rules/${coretype}_providers/${provider_temp_file}
|
||||
get_bin "$TMPDIR"/provider_temp_file "rules/${coretype}_providers/$provider_temp_file"
|
||||
[ -z "$(grep -o 'rules' "$TMPDIR"/provider_temp_file)" ] && {
|
||||
echo -e "\033[31m下载失败,请尝试更换安装源!\033[0m"
|
||||
. "$CRASHDIR"/menus/9_upgrade.sh && setserver
|
||||
@@ -469,16 +469,16 @@ EOF
|
||||
EOF
|
||||
}
|
||||
if [ -z "$(grep "provider_temp_${coretype}" "$CRASHDIR"/configs/ShellCrash.cfg)" ];then
|
||||
provider_temp_file=$(sed -n "1 p" "$CRASHDIR"/configs/${coretype}_providers.list | awk '{print $2}')
|
||||
provider_temp_file="$TMPDIR/$(sed -n "1 p" "$CRASHDIR"/configs/${coretype}_providers.list | awk '{print $2}')"
|
||||
else
|
||||
provider_temp_file=$(grep "provider_temp_${coretype}" "$CRASHDIR"/configs/ShellCrash.cfg | awk -F '=' '{print $2}')
|
||||
fi
|
||||
echo "-----------------------------------------------"
|
||||
if [ -s ${provider_temp_file} ];then
|
||||
ln -sf ${provider_temp_file} "$TMPDIR"/provider_temp_file
|
||||
if [ -s "$provider_temp_file" ];then
|
||||
ln -sf "$provider_temp_file" "$TMPDIR"/provider_temp_file
|
||||
else
|
||||
echo -e "\033[33m正在获取在线模版!\033[0m"
|
||||
get_bin "$TMPDIR"/provider_temp_file rules/${coretype}_providers/${provider_temp_file}
|
||||
get_bin "$TMPDIR"/provider_temp_file "rules/${coretype}_providers/$provider_temp_file"
|
||||
[ -z "$(grep -o 'route' "$TMPDIR"/provider_temp_file)" ] && {
|
||||
echo -e "\033[31m下载失败,请尝试更换安装源!\033[0m"
|
||||
. "$CRASHDIR"/menus/9_upgrade.sh && setserver
|
||||
|
||||
@@ -28,7 +28,13 @@ gateway(){
|
||||
case "$num" in
|
||||
0) ;;
|
||||
1)
|
||||
set_fw_wan
|
||||
echo "-----------------------------------------------"
|
||||
if [ -n "$(pidof CrashCore)" ] && [ "$firewall_mod" = 'iptables' ]; then
|
||||
read -p "需要先停止服务,是否继续?(1/0) > " res
|
||||
[ "$res" = 1 ] && "$CRASHDIR"/start.sh stop && set_fw_wan
|
||||
else
|
||||
set_fw_wan
|
||||
fi
|
||||
gateway
|
||||
;;
|
||||
2)
|
||||
|
||||
@@ -7,7 +7,7 @@ __IS_MODULE_DNS_LOADED=1
|
||||
set_dns_mod() { #DNS模式设置
|
||||
[ -z "$hosts_opt" ] && hosts_opt=ON
|
||||
[ -z "$dns_protect" ] && dns_protect=ON
|
||||
[ -z "$ecs_subnet" ] && ecs_subnet=OFF || ecs_subnet=ON
|
||||
[ -z "$ecs_subnet" ] && ecs_subnet=OFF
|
||||
echo "-----------------------------------------------"
|
||||
echo -e "当前DNS运行模式为:\033[47;30m $dns_mod \033[0m"
|
||||
echo -e "\033[33m切换模式后需要手动重启服务以生效!\033[0m"
|
||||
|
||||
Reference in New Issue
Block a user