summaryrefslogtreecommitdiffstats
path: root/src/sbin
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-10-01 10:21:43 -0300
committerRenato Botelho <renato@netgate.com>2015-10-01 10:21:43 -0300
commita5c36eb22154a2f17bba4329ee85627eeb64b664 (patch)
treec3bfe52067f1af8586dd85c2118cb66f55d2b227 /src/sbin
parent339b88930513dec2bc986df7c0cd7255b6815d56 (diff)
downloadpfsense-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-xsrc/sbin/dhclient-script4
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
OpenPOWER on IntegriCloud