diff --git a/scripts/lang/chs/dns.lang b/scripts/lang/chs/dns.lang index 6e05e673..e2930422 100644 --- a/scripts/lang/chs/dns.lang +++ b/scripts/lang/chs/dns.lang @@ -51,17 +51,6 @@ DNS_IPV6_NOT_SUPPORT="该选项暂不支持IPv6加密DNS!" DNS_ENCRYPT_OK="已设置加密DNS,如遇DNS解析问题,请重置DNS配置!" DNS_CORE_REQUIRE="请使用Mihomo或SingBox内核" DNS_SET_TO="设为" -DNS_PROTECT_NOW="当前" -DNS_HOSTS_NOW="当前" -DNS_ENABLED="已启用" -DNS_DISABLED="已禁用" -DNS_PROTECT_DISABLE_Q="DNS防泄漏,是否确认禁用?" -DNS_PROTECT_ENABLE_Q="DNS防泄漏,是否确认启用?" -DNS_HOSTS_DISABLE_Q="Hosts优化,是否确认禁用?" -DNS_HOSTS_ENABLE_Q="Hosts优化,是否确认启用?" -DNS_YES="是" -DNS_RESET_DEFAULT="重置为默认值" -DNS_NO_BACK="否,返回上级菜单" DNS_REMOVE_OK="移除成功" DNS_REMOVE_FAIL="移除失败" DNS_INPUT_REDIR_PORT="请直接输入旁路由IPV4地址" diff --git a/scripts/lang/en/dns.lang b/scripts/lang/en/dns.lang index d2578ec5..25293cd4 100644 --- a/scripts/lang/en/dns.lang +++ b/scripts/lang/en/dns.lang @@ -53,17 +53,6 @@ DNS_IPV6_NOT_SUPPORT="This option does not support IPv6 encrypted DNS!" DNS_ENCRYPT_OK="Encrypted DNS has been configured. If DNS issues occur, please reset DNS settings." DNS_CORE_REQUIRE="Please use the Mihomo or SingBox core" DNS_SET_TO="Set to" -DNS_PROTECT_NOW="Current status: " -DNS_HOSTS_NOW="Current status: " -DNS_ENABLED="enabled" -DNS_DISABLED="disabled" -DNS_PROTECT_DISABLE_Q=" DNS leak protection. Disable now?" -DNS_PROTECT_ENABLE_Q=" DNS leak protection. Enable now?" -DNS_HOSTS_DISABLE_Q=" Hosts optimization. Disable now?" -DNS_HOSTS_ENABLE_Q=" Hosts optimization. Enable now?" -DNS_YES="Yes" -DNS_RESET_DEFAULT="Reset to defaults" -DNS_NO_BACK="No, back" DNS_REMOVE_OK="Removed successfully" DNS_REMOVE_FAIL="Remove failed" DNS_INPUT_REDIR_PORT="Please input bypass-router IPv4 address" diff --git a/scripts/menu.sh b/scripts/menu.sh index 8772d222..3d67e5a8 100644 --- a/scripts/menu.sh +++ b/scripts/menu.sh @@ -153,7 +153,7 @@ ckstatus() { zip_type=$(echo "$file" | grep -oE 'tar.gz$|upx$|gz$') . "$CRASHDIR"/menus/9_upgrade.sh && setcoretype . "$CRASHDIR"/libs/core_tools.sh && core_check "/tmp/$file" - if [ "$?" = 0 ]; then + if [ "$?" = 0 ] && [ -n "$crashcore" ]; then msg_alert "\033[32m$MENU_CORE_LOADED_OK\033[0m" switch_core else diff --git a/scripts/menus/dns.sh b/scripts/menus/dns.sh index 7294fce3..ee328a36 100644 --- a/scripts/menus/dns.sh +++ b/scripts/menus/dns.sh @@ -48,116 +48,31 @@ set_dns_mod() { msg_alert "\033[36m$DNS_SET_OK:$dns_mod\033[0m" ;; 4) - while true; do - line_break - separator_line "=" - if [ "$dns_protect" = ON ]; then - content_line "$DNS_PROTECT_NOW\033[33m$DNS_ENABLED\033[0m$DNS_PROTECT_DISABLE_Q" - else - content_line "$DNS_PROTECT_NOW\033[33m$DNS_DISABLED\033[0m$DNS_PROTECT_ENABLE_Q" - fi - separator_line "=" - btm_box "1) $DNS_YES" \ - "2) $DNS_RESET_DEFAULT" \ - "0) $DNS_NO_BACK" - read -r -p "$COMMON_INPUT> " num - case "$num" in - 0) - break - ;; - 1) - if [ "$dns_protect" = ON ]; then - dns_protect=OFF - else - dns_protect=ON - fi - ;; - 2) - dns_protect=ON - ;; - *) - errornum - continue - ;; - esac - setconfig dns_protect "$dns_protect" - common_success - done + if [ "$dns_protect" = ON ]; then + dns_protect=OFF + else + dns_protect=ON + fi + setconfig dns_protect "$dns_protect" + common_success ;; 5) - while true; do - line_break - separator_line "=" - if [ "$hosts_opt" = ON ]; then - content_line "$DNS_HOSTS_NOW\033[33m$DNS_ENABLED\033[0m$DNS_HOSTS_DISABLE_Q" - else - content_line "$DNS_HOSTS_NOW\033[33m$DNS_DISABLED\033[0m$DNS_HOSTS_ENABLE_Q" - fi - separator_line "=" - btm_box "1) $DNS_YES" \ - "2) $DNS_RESET_DEFAULT" \ - "0) $DNS_NO_BACK" - read -r -p "$COMMON_INPUT> " num - case "$num" in - 0) - break - ;; - 1) - if [ "$hosts_opt" = ON ]; then - hosts_opt=OFF - else - hosts_opt=ON - fi - ;; - 2) - hosts_opt=ON - ;; - *) - errornum - continue - ;; - esac - setconfig dns_protect "$hosts_opt" - common_success - done + if [ "$hosts_opt" = ON ]; then + hosts_opt=OFF + else + hosts_opt=ON + fi + setconfig hosts_opt "$hosts_opt" + common_success ;; 6) - - while true; do - line_break - separator_line "=" - if [ "$ecs_subnet" = ON ]; then - content_line "$DNS_HOSTS_NOW\033[33m$DNS_ENABLED\033[0m$DNS_HOSTS_DISABLE_Q" - else - content_line "$DNS_HOSTS_NOW\033[33m$DNS_DISABLED\033[0m$DNS_HOSTS_ENABLE_Q" - fi - separator_line "=" - btm_box "1) $DNS_YES" \ - "2) $DNS_RESET_DEFAULT" \ - "0) $DNS_NO_BACK" - read -r -p "$COMMON_INPUT> " num - case "$num" in - 0) - break - ;; - 1) - if [ "$ecs_subnet" = ON ]; then - ecs_subnet=OFF - else - ecs_subnet=ON - fi - ;; - 2) - ecs_subnet=OFF - ;; - *) - errornum - continue - ;; - esac - setconfig dns_protect "$ecs_subnet" - common_success - done + if [ "$ecs_subnet" = ON ]; then + ecs_subnet=OFF + else + ecs_subnet=ON + fi + setconfig ecs_subnet "$ecs_subnet" + common_success ;; 7) while true; do