# Desc: convert gfwlist.txt into dnsmasq.conf # Dependency: base64, curl(https support), perl5 v5.10.0+ # Usage: bash gfwlist2dnsmasq [-s <addr>] [-p <port>] [-n <name>] [-l] # -s <addr> dns server addr for resolve gfwlist domain. (default: 127.0.0.1) # -p <port> dns server port for resolve gfwlist domain. (default: 60053) # -n <name> which ipset will be saved the IP. (resolved from gfwlist domain) # if this option is not set, the ipset rule will not be generated. # -l generate gfwlist domain list instead of dnsmasq conf. # if this option is set, other options will be ignored. # -h show this help and exit.
# check dependency command -v curl &>/dev/null || { echo "curl is not installed in this system" 1>&2; exit 1; } command -v perl &>/dev/null || { echo "perl is not installed in this system" 1>&2; exit 1; } command -v base64 &>/dev/null || { echo "base64 is not installed in this system" 1>&2; exit 1; }
# parse command line while getopts ":s:p:n:lh" OPT; do case $OPT in s) dns_addr="$OPTARG";; n) set_name="$OPTARG";; l) dom_list="true";; h) cat << EOF Usage: bash gfwlist2dnsmasq [-s <addr>] [-p <port>] [-n <name>] [-l] -s <addr> dns server addr for resolve gfwlist domain. (default: 127.0.0.1) -h show this help and exit. EOF exit;; :) echo "Missing argument to '-$OPTARG'" 1>&2; exit 1;; \?) echo "Unknown option '-$OPTARG'" 1>&2;; esac done
# temporary file test -z "$dom_list" && temporary_file=$(mktemp) || temporary_file='domain_list.txt'
wget https://github.com/grahamedgecombe/ct-submit/archive/v1.1.2.zip unzip v1.1.2.zip cd ct-submit-1.1.2 go build wget https://github.com/grahamedgecombe/ct-submit/archive/v1.1.2.zip unzip v1.1.2.zip cd ct-submit-1.1.2 go build ./ct-submit-1.1.2 ct1.digicert-ct.com/log </usr/local/nginx/conf/cert.pem >/usr/local/nginx/conf/digicert.sct