mirror of https://github.com/dnomd343/ClearDNS
dnomd343
3 years ago
5 changed files with 65 additions and 47 deletions
@ -1,32 +0,0 @@ |
|||
[ -f "/etc/cleardns/custom.sh" ] && sh /etc/cleardns/custom.sh |
|||
|
|||
mkdir -p /etc/cleardns/list |
|||
mkdir -p /etc/cleardns/upstream |
|||
mkdir -p /etc/cleardns/AdGuardHome |
|||
|
|||
[ ! -s "/etc/cleardns/upstream/domestic.conf" ] && echo -e "223.5.5.5\n119.29.29.29\n114.114.114.114" > /etc/cleardns/upstream/domestic.conf |
|||
[ ! -s "/etc/cleardns/upstream/foreign.conf" ] && echo -e "8.8.4.4\n8.8.8.8" > /etc/cleardns/upstream/foreign.conf |
|||
|
|||
cat /etc/cleardns/upstream/domestic.conf | sed 's/^[ \t]*//g' | sed 's/[ \t]*$//g' | tr -s '\n' | sed '/^#/d' | sed '/^\/\//d' > /etc/cleardns/upstream/domestic |
|||
cat /etc/cleardns/upstream/foreign.conf | sed 's/^[ \t]*//g' | sed 's/[ \t]*$//g' | tr -s '\n' | sed '/^#/d' | sed '/^\/\//d' > /etc/cleardns/upstream/foreign |
|||
|
|||
cmd="dnsproxy -p 4053" |
|||
while read -r raw |
|||
do |
|||
cmd="$cmd -u $raw" |
|||
done < /etc/cleardns/upstream/domestic |
|||
eval "$cmd --cache --cache-size=4194304 --all-servers > /dev/null 2>&1 &" |
|||
|
|||
cmd="dnsproxy -p 6053" |
|||
while read -r raw |
|||
do |
|||
cmd="$cmd -u $raw" |
|||
done < /etc/cleardns/upstream/foreign |
|||
eval "$cmd --cache --cache-size=4194304 --all-servers > /dev/null 2>&1 &" |
|||
|
|||
rm -f /etc/cleardns/upstream/domestic |
|||
rm -f /etc/cleardns/upstream/foreign |
|||
|
|||
/etc/overture/update.sh |
|||
/usr/sbin/crond |
|||
/usr/bin/AdGuardHome -p 80 -w /etc/cleardns/AdGuardHome --no-check-update |
@ -0,0 +1,42 @@ |
|||
#!/bin/sh |
|||
mkdir -p /etc/cleardns/asset/ |
|||
mkdir -p /etc/cleardns/AdGuardHome/ |
|||
|
|||
cleardns_dir="/etc/cleardns" |
|||
overture_dir="/etc/overture" |
|||
cd $overture_dir && tar xf asset.tar |
|||
[ ! -f "$cleardns_dir/gfwlist.txt" ] && cp "$overture_dir/gfwlist.txt" "$cleardns_dir/gfwlist.txt" |
|||
[ ! -f "$cleardns_dir/chinalist.txt" ] && cp "$overture_dir/chinalist.txt" "$cleardns_dir/chinalist.txt" |
|||
[ ! -f "$cleardns_dir/china_ip.txt" ] && cp "$overture_dir/china_ip.txt" "$cleardns_dir/china_ip.txt" |
|||
|
|||
upstream_file="/etc/cleardns/upstream.json" |
|||
if [ ! -f "$upstream_file" ]; then |
|||
cat > $upstream_file << EOF |
|||
{ |
|||
"domestic": { |
|||
"bootstrap": "223.5.5.5", |
|||
"primary": [ |
|||
"tls://dns.alidns.com", |
|||
"https://doh.pub/dns-query" |
|||
], |
|||
"fallback": [ |
|||
"223.5.5.5", |
|||
"119.29.29.29" |
|||
] |
|||
}, |
|||
"foreign": { |
|||
"bootstrap": "8.8.8.8", |
|||
"primary": [ |
|||
"tls://dns.google", |
|||
"https://dns.cloudflare.com/dns-query" |
|||
], |
|||
"fallback": [ |
|||
"1.1.1.1", |
|||
"8.8.8.8" |
|||
] |
|||
} |
|||
} |
|||
EOF |
|||
fi |
|||
|
|||
/etc/overture/update.sh& |
Loading…
Reference in new issue