From 3b81e35e74018161bee320293dd43fdadf0f86e1 Mon Sep 17 00:00:00 2001 From: dnomd343 Date: Wed, 19 May 2021 22:40:32 +0800 Subject: [PATCH] fix: local storage the list files, generate config file of smartdns --- overture/config.yml | 6 +++--- overture/update.sh | 18 ++++++++++++------ smartdns/{config.conf => base.conf} | 0 smartdns/load.sh | 1 + 4 files changed, 16 insertions(+), 9 deletions(-) rename smartdns/{config.conf => base.conf} (100%) diff --git a/overture/config.yml b/overture/config.yml index d11412b..e34741d 100644 --- a/overture/config.yml +++ b/overture/config.yml @@ -24,11 +24,11 @@ ipv6UseAlternativeDNS: false alternativeDNSConcurrent: false whenPrimaryDNSAnswerNoneUse: alternativeDNS ipNetworkFile: - primary: /etc/overture/china_ip_list.txt + primary: /etc/overture/list/china_ip_list.txt alternative: /etc/overture/loopback.txt domainFile: - primary: /etc/overture/chinalist.txt - alternative: /etc/overture/gfwlist.txt + primary: /etc/overture/list/chinalist.txt + alternative: /etc/overture/list/gfwlist.txt matcher: suffix-tree hostsFile: hostsFile: /etc/overture/hosts diff --git a/overture/update.sh b/overture/update.sh index 5baefe8..a9f621e 100755 --- a/overture/update.sh +++ b/overture/update.sh @@ -1,8 +1,14 @@ -rm -f /etc/overture/chinalist.txt -rm -f /etc/overture/gfwlist.txt -rm -f /etc/overture/china_ip_list.txt -wget -P /etc/overture https://res.343.re/Share/chinalist/chinalist.txt -wget -P /etc/overture https://res.343.re/Share/gfwlist/gfwlist.txt -wget -P /etc/overture https://raw.fastgit.org/17mon/china_ip_list/master/china_ip_list.txt +OVERTURE_DIR="/etc/overture" +TEMP_DIR="$OVERTURE_DIR/list/temp" +[ -f "$OVERTURE_DIR/list/no_auto_update" ] && exit +rm -rf $TEMP_DIR +mkdir -p $TEMP_DIR +wget -P $TEMP_DIR https://res.343.re/Share/chinalist/chinalist.txt +wget -P $TEMP_DIR https://res.343.re/Share/gfwlist/gfwlist.txt +wget -P $TEMP_DIR https://raw.fastgit.org/17mon/china_ip_list/master/china_ip_list.txt +[ -s "$TEMP_DIR/chinalist.txt" ] && mv -f $TEMP_DIR/chinalist.txt $OVERTURE_DIR/list/ +[ -s "$TEMP_DIR/gfwlist.txt" ] && mv -f $TEMP_DIR/gfwlist.txt $OVERTURE_DIR/list/ +[ -s "$TEMP_DIR/china_ip_list.txt" ] && mv -f $TEMP_DIR/china_ip_list.txt $OVERTURE_DIR/list/ +rm -rf $TEMP_DIR ps -ef | grep overture | grep -v grep | grep -v sh | awk '{print $1}' | xargs kill -9 overture -c /etc/overture/config.yml > /dev/null 2>&1 & diff --git a/smartdns/config.conf b/smartdns/base.conf similarity index 100% rename from smartdns/config.conf rename to smartdns/base.conf diff --git a/smartdns/load.sh b/smartdns/load.sh index 8111805..6e135ef 100755 --- a/smartdns/load.sh +++ b/smartdns/load.sh @@ -19,6 +19,7 @@ EOF mkdir -p /etc/smartdns/expose/ [ ! -s "/etc/smartdns/expose/domestic.conf" ] && load_domestic [ ! -s "/etc/smartdns/expose/foreign.conf" ] && load_foreign +cat /etc/smartdns/base.conf > /etc/smartdns/config.conf cat /etc/smartdns/expose/domestic.conf >> /etc/smartdns/config.conf while read -r raw do