diff options
author | Renato Botelho <renato@netgate.com> | 2015-10-01 10:21:43 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-10-01 10:21:43 -0300 |
commit | a5c36eb22154a2f17bba4329ee85627eeb64b664 (patch) | |
tree | c3bfe52067f1af8586dd85c2118cb66f55d2b227 /src/sbin | |
parent | 339b88930513dec2bc986df7c0cd7255b6815d56 (diff) | |
download | pfsense-a5c36eb22154a2f17bba4329ee85627eeb64b664.zip pfsense-a5c36eb22154a2f17bba4329ee85627eeb64b664.tar.gz |
Introduce read_xml_tag.sh
Create /usr/local/sbin/read_xml_tag.sh, that will read a xml tag from
config file using xmllint. Replace all direct read using cat, grep, sed,
... by this script
Diffstat (limited to 'src/sbin')
-rwxr-xr-x | src/sbin/dhclient-script | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sbin/dhclient-script b/src/sbin/dhclient-script index 9d71aaf..98e4aa8 100755 --- a/src/sbin/dhclient-script +++ b/src/sbin/dhclient-script @@ -268,12 +268,12 @@ add_new_resolv_conf() { fi if [ -n "$new_domain_name_servers" ]; then /bin/rm -f /var/etc/nameserver_$interface - ALLOWOVERRIDE=`/usr/bin/grep dnsallowoverride /conf/config.xml | /usr/bin/wc -l` + ALLOWOVERRIDE=$(/usr/local/sbin/read_xml_tag.sh boolean system/dnsallowoverride) for nameserver in $new_domain_name_servers; do # Add a route to the nameserver out the correct interface # so that mulitple wans work correctly with multiple dns # also backup the nameserver for later route removal - if [ $ALLOWOVERRIDE -gt 0 ]; then + if [ "$ALLOWOVERRIDE" = "true" ]; then echo $nameserver >>/var/etc/nameserver_$interface $ROUTE add $nameserver -iface $interface fi |