Skip to content

Instantly share code, notes, and snippets.

@dgeibi
Last active February 6, 2016 15:10
Show Gist options
  • Select an option

  • Save dgeibi/f77456a679e307e9e90d to your computer and use it in GitHub Desktop.

Select an option

Save dgeibi/f77456a679e307e9e90d to your computer and use it in GitHub Desktop.
dnsmasq-china-list --> Pcap_DNSProxy WhiteList.txt
@echo off
(
echo [Local Hosts]
echo ## China mainland domains
echo ## Sources: https://github.com/felixonmars/dnsmasq-china-list
echo.
) > "WhiteList.txt"
Tools\Routing_Update\bin\curl -O https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf
Tools\Routing_Update\bin\sed -e "s@/114.114.114.114$@@" -e "s@\.@\\\.@g" -e "s@server=/@\.*\\\b@" -e "s@bcn$@\.cn\$@" accelerated-domains.china.conf >> WhiteList.txt
del accelerated-domains.china.conf
:continue
set/p X=Use google.china.conf? [y/n]:
if /i "%X%"=="y" goto google
if /i "%X%"=="n" goto default
goto continue
:google
Tools\Routing_Update\bin\curl -O https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf
Tools\Routing_Update\bin\sed -e "s@/114.114.114.114$@@" -e "s@\.@\\\.@g" -e "s@server=/@\.*\\\b@" google.china.conf >> WhiteList.txt
del google.china.conf
pause
:default
pause
#!/bin/bash
curl -O https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/accelerated-domains.china.conf
echo -e '[Local Hosts]\n## China mainland domains\n## Sources: https://github.com/felixonmars/dnsmasq-china-list\n' > WhiteList.txt
sed -e "s|/114.114.114.114$||" -e "s|\.|\\\.|g" -e "s|server=/|\.*\\\b|" -e "s|bcn$|\.cn\$|" accelerated-domains.china.conf >> WhiteList.txt
read -p "Use google.china.conf?[y/n]:" yn
if [ "${yn}" == "Y" ] || [ "${yn}" == "y" ]; then
curl -O https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/master/google.china.conf
sed -e "s|/114.114.114.114$||" -e "s|\.|\\\.|g" -e "s|server=/|\.*\\\b|" google.china.conf >> WhiteList.txt
rm google.china.conf
fi
rm accelerated-domains.china.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment