OpenWrt_Luci_Lua/1_9.r18_plugin/adbyby/bin/ipset.sh
2016-02-16 15:48:49 +08:00

10 lines
339 B
Bash
Executable File

#!/bin/sh
ipset -N adbyby_list hash:ip
iptables -t nat -A PREROUTING -p tcp -m set --match-set adbyby_list dst -j REDIRECT --to-port 8118
sed -e '/.*adbyby_host.conf/d' -i /etc/dnsmasq.conf
echo "conf-file=/tmp/adbyby_host.conf" >> "/etc/dnsmasq.conf"
#/etc/storage/dnsmasq/dnsmasq.conf
restart_dhcpd
/etc/init.d/dnsmasq restart