#!/bin/sh
# adblock.sh
# adblock.sh
url=https://pgl.yoyo.org/as/serverlist.php?hostformat=dnsmasq-server;showintro=0
conf=/etc/dnsmasq.d/adblock.conf
tmp=${conf}.tmp
wget --no-check-certificate "${url}" -q -O ${tmp}
[ $? -gt 0 ]&&exit $?;
cat ${tmp}|grep server= >${conf}
[ -f "${tmp}" ]&&rm ${tmp};
dnsmasq -C ${conf} --test && /etc/init.d/dnsmasq restart || rm ${conf};
沒有留言:
張貼留言