-
Notifications
You must be signed in to change notification settings - Fork 2
/
remote-130-chn_domains.sh
30 lines (27 loc) · 1.18 KB
/
remote-130-chn_domains.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# if ! grep -qF '/etc/chn-domains' /etc/init.d/dnsmasq; then
# echo 'patch /etc/init.d/dnsmasq'
# sed -i -e '/config_foreach dhcp_cname_add cname/{
# n
# n
# a \
# while read domain; do echo "server=/$domain/'$config_dnsmasq_local_dns'"; done < /etc/chn-domains >> $CONFIGFILE\
# echo "server=/./'$config_chn_domains_remote_dns'" >> $CONFIGFILE\
# }' /etc/init.d/dnsmasq
# fi
if [ "$config_chn_domains_dnsmasq_full" = '1' ]; then
oc_opkg_remove dnsmasq
if [ ! -e /tmp/resolv.conf ]; then
cp /tmp/resolv.conf.auto /tmp/resolv.conf
fi
oc_opkg_install dnsmasq-full
oc_remove /etc/config/dhcp-opkg
fi
if [ ! -e /tmp/dnsmasq.d/99-chn-domains.conf ]; then
echo 'run /etc/hotplug.d/iface/99-chn-domains'
INTERFACE='wan' ACTION='ifup' sh /etc/hotplug.d/iface/99-chn-domains
fi
if [ /etc/chn-domains.gz -nt /tmp/dnsmasq.d/99-chn-domains.conf ] || [ /etc/chn-domains-extra -nt /tmp/dnsmasq.d/99-chn-domains.conf ] || [ /etc/hotplug.d/iface/99-chn-domains -nt /tmp/dnsmasq.d/99-chn-domains.conf ]; then
echo 'run /etc/hotplug.d/iface/99-chn-domains'
rm /tmp/dnsmasq.d/99-chn-domains.conf
INTERFACE='wan' ACTION='ifup' sh /etc/hotplug.d/iface/99-chn-domains
fi