refacter project

This commit is contained in:
bgme 2025-02-07 07:15:25 +08:00
parent 47a51c431d
commit f7d7b68fa0
6 changed files with 665 additions and 13 deletions

16
dnsmasq-china-list.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
PROXY="socks5h://127.0.0.1:1080"
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
CACHE_FOLDER="${SCRIPT_DIR}/cache"
mkdir -p "${CACHE_FOLDER}"
curl --proxy "${PROXY}" https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/refs/heads/master/accelerated-domains.china.conf -o "${CACHE_FOLDER}/accelerated-domains.china.conf"
curl --proxy "${PROXY}" https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/refs/heads/master/google.china.conf -o "${CACHE_FOLDER}/google.china.conf"
curl --proxy "${PROXY}" https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/refs/heads/master/apple.china.conf -o "${CACHE_FOLDER}/apple.china.conf"
curl --proxy "${PROXY}" https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/refs/heads/master/bogus-nxdomain.china.conf -o "${CACHE_FOLDER}/bogus-nxdomain.china.conf"
cp "${CACHE_FOLDER}/*.conf" /tmp/dnsmasq.d/
grep -v '^#' "${CACHE_FOLDER}/bogus-nxdomain.china.conf" | grep -v '^$' | sed -e 's/=/ /g' > /etc/smartdns/conf.d/bogus-nxdomain.conf