From 4030bdc4f3aa3d527e1c0ddbd1cfa4864f47e86c Mon Sep 17 00:00:00 2001 From: zhao Date: Tue, 4 Feb 2025 14:21:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20bin/=20ZeroWrt.backup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhao --- bin/ ZeroWrt.backup | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bin/ ZeroWrt.backup b/bin/ ZeroWrt.backup index 6d3190b..7ad36b6 100644 --- a/bin/ ZeroWrt.backup +++ b/bin/ ZeroWrt.backup @@ -264,7 +264,6 @@ one_click_setup() { # 设置LAN口DNS uci set network.lan.dns='127.0.0.1' uci commit network - /etc/init.d/network restart # 恢复 MosDNS 配置 cp /etc/config/default_mosdns /etc/config/mosdns @@ -313,9 +312,9 @@ one_click_setup() { # AdguardHome 设置 cp /etc/config/default_AdGuardHome /etc/config/AdGuardHome.yaml - sed -i 's/cache_size: .*/cache_size: 0/' /etc/AdGuardHome.yaml - sed -i 's/upstream_mode: .*/upstream_mode: parallel/' /etc/AdGuardHome.yaml - sed -i 's/upstream_dns_file:.*/upstream_dns_file: \/etc\/AdGuardHome-dnslist.yaml/' /etc/AdGuardHome.yaml + sed -i 's/cache_size: .*/cache_size: 0/' /etc/config/AdGuardHome.yaml + sed -i 's/upstream_mode: .*/upstream_mode: parallel/' /etc/config/AdGuardHome.yaml + sed -i 's/upstream_dns_file:.*/upstream_dns_file: \/etc\/AdGuardHome-dnslist.yaml/' /etc/config/AdGuardHome.yaml uci set AdGuardHome.AdGuardHome.enabled='1' uci set AdGuardHome.AdGuardHome.redirect='dnsmasq-upstream' uci commit AdGuardHome @@ -388,7 +387,6 @@ one_click_setup() { # 设置LAN口DNS uci set network.lan.dns='127.0.0.1' uci commit network - /etc/init.d/network restart # 恢复 SmartDNS 配置 cp /etc/config/default_smartdns /etc/config/smartdns @@ -429,9 +427,9 @@ one_click_setup() { # 配置 AdGuardHome cp /etc/config/default_AdGuardHome /etc/config/AdGuardHome.yaml - sed -i 's/upstream_dns_file:.*/upstream_dns_file: \/etc\/AdGuardHome-mosdns.yaml/' /etc/AdGuardHome.yaml - sed -i 's/cache_size: .*/cache_size: 0/' /etc/AdGuardHome.yaml - sed -i 's|upstream_dns_file: ""|upstream_dns_file: "/etc/AdGuardHome-mosdns.yaml"|' /etc/AdGuardHome.yaml + sed -i 's/upstream_dns_file:.*/upstream_dns_file: \/etc\/AdGuardHome-mosdns.yaml/' /etc/config/AdGuardHome.yaml + sed -i 's/cache_size: .*/cache_size: 0/' /etc/config/AdGuardHome.yaml + sed -i 's/upstream_mode: .*/upstream_mode: parallel/' /etc/config/AdGuardHome.yaml uci set AdGuardHome.AdGuardHome.enabled='1' uci set AdGuardHome.AdGuardHome.redirect='dnsmasq-upstream' uci commit AdGuardHome @@ -504,7 +502,6 @@ one_click_setup() { # 取消LAN口DNS uci delete network.lan.dns uci commit network - /etc/init.d/network restart # 恢复 SmartDNS 配置 cp /etc/config/default_smartdns /etc/config/smartdns /etc/init.d/smartdns restart @@ -512,7 +509,11 @@ one_click_setup() { cp /etc/config/default_mosdns /etc/config/mosdns /etc/init.d/mosdns restart # 恢复 adguardhome + uci set AdGuardHome.AdGuardHome.enabled='0' + uci set AdGuardHome.AdGuardHome.redirect='none' cp /etc/config/default_AdGuardHome /etc/config/AdGuardHome.yaml + sed -i 's/upstream_dns_file:.*/upstream_dns_file: \/etc\/AdGuardHome-dns.yaml/' /etc/config/AdGuardHome.yaml + uci commit AdGuardHome /etc/init.d/AdGuardHome restart # 恢复 passwall cp /etc/config/default_passwall /etc/config/passwall