summaryrefslogtreecommitdiffstats
path: root/src/usr/local/sbin/ppp-linkup
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/usr/local/sbin/ppp-linkup
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/usr/local/sbin/ppp-linkup')
-rwxr-xr-xsrc/usr/local/sbin/ppp-linkup6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/usr/local/sbin/ppp-linkup b/src/usr/local/sbin/ppp-linkup
index 2d1eb33..e6604a3 100755
--- a/src/usr/local/sbin/ppp-linkup
+++ b/src/usr/local/sbin/ppp-linkup
@@ -2,6 +2,8 @@
export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin
+DNSALLOWOVERRIDE=$(/usr/local/sbin/read_xml_tag.sh boolean system/dnsallowoverride)
+
if [ "${2}" == "inet" ]; then
OLD_ROUTER=`cat /tmp/${1}_router`
@@ -16,7 +18,7 @@ if [ "${2}" == "inet" ]; then
echo ${3} > /tmp/${1}_ip
touch /tmp/${1}up
- if grep -q dnsallowoverride /conf/config.xml; then
+ if [ "${DNSALLOWOVERRIDE}" = "true" ]; then
# write nameservers to file
echo -n "" > /var/etc/nameserver_${1}
if echo "${6}" | grep -q dns1; then
@@ -40,7 +42,7 @@ elif [ "${2}" == "inet6" ]; then
echo ${3} |cut -d% -f1 > /tmp/${1}_ipv6
touch /tmp/${1}upv6
- if grep -q dnsallowoverride /conf/config.xml; then
+ if [ "${DNSALLOWOVERRIDE}" = "true" ]; then
# write nameservers to file
echo -n "" > /var/etc/nameserver_v6${1}
if echo "${6}" | grep -q dns1; then
OpenPOWER on IntegriCloud