summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-08-15 08:39:07 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-08-15 08:39:07 -0300
commitc0fc63d15abd3cff89f4081934d090813c00d8c6 (patch)
tree3d0a45780cd08f582d2b71f82248e7ca60fe89ba /usr/local/sbin
parent174a331e194eed383615ac75bbd21a156ea865a0 (diff)
downloadpfsense-c0fc63d15abd3cff89f4081934d090813c00d8c6.zip
pfsense-c0fc63d15abd3cff89f4081934d090813c00d8c6.tar.gz
Improve sh syntax using ${} for all variables
Diffstat (limited to 'usr/local/sbin')
-rwxr-xr-xusr/local/sbin/ppp-linkup58
1 files changed, 29 insertions, 29 deletions
diff --git a/usr/local/sbin/ppp-linkup b/usr/local/sbin/ppp-linkup
index 1e9fdaa..f15f0fb 100755
--- a/usr/local/sbin/ppp-linkup
+++ b/usr/local/sbin/ppp-linkup
@@ -1,60 +1,60 @@
#!/bin/sh
-if [ "$2" == "inet" ]; then
+if [ "${2}" == "inet" ]; then
OLD_ROUTER=`/bin/cat /tmp/${1}_router`
if [ "${OLD_ROUTER}" != "" ]; then
echo "Removing states to old router ${OLD_ROUTER}" | logger -t ppp-linkup
- /sbin/pfctl -i $1 -k 0.0.0.0/0 -k ${OLD_ROUTER}/32
- /sbin/pfctl -i $1 -k ${OLD_ROUTER}/32 -k 0.0.0.0/0
+ /sbin/pfctl -i ${1} -k 0.0.0.0/0 -k ${OLD_ROUTER}/32
+ /sbin/pfctl -i ${1} -k ${OLD_ROUTER}/32 -k 0.0.0.0/0
fi
# let the configuration system know that the ipv4 has changed.
- /bin/echo $4 > /tmp/$1_router
- /bin/echo $3 > /tmp/$1_ip
- /usr/bin/touch /tmp/$1up
+ /bin/echo ${4} > /tmp/${1}_router
+ /bin/echo ${3} > /tmp/${1}_ip
+ /usr/bin/touch /tmp/${1}up
ALLOWOVERRIDE=`/usr/bin/grep -c dnsallowoverride /conf/config.xml`
- if [ $ALLOWOVERRIDE -gt 0 ]; then
+ if [ ${ALLOWOVERRIDE} -gt 0 ]; then
# write nameservers to file
- if [ "`echo $6|grep -c dns1`" -gt 0 ]; then
- DNS1=`echo $6 |awk '{print $2}'`
- echo "$DNS1"> /var/etc/nameserver_$1
- /sbin/route change "$DNS1" $4
+ if [ "`echo ${6}|grep -c dns1`" -gt 0 ]; then
+ DNS1=`echo ${6} |awk '{print ${2}}'`
+ echo "${DNS1}"> /var/etc/nameserver_${1}
+ /sbin/route change "${DNS1}" ${4}
fi
- if [ "`echo $7|grep -c dns2`" -gt 0 ]; then
- DNS2=`echo $7 |awk '{print $2}'`
- echo "$DNS2" >> /var/etc/nameserver_$1
- /sbin/route change "$DNS2" $4
+ if [ "`echo ${7}|grep -c dns2`" -gt 0 ]; then
+ DNS2=`echo ${7} |awk '{print ${2}}'`
+ echo "${DNS2}" >> /var/etc/nameserver_${1}
+ /sbin/route change "${DNS2}" ${4}
fi
/usr/local/sbin/pfSctl -c 'service reload dns'
/bin/sleep 1
fi
fi
-if [ "$2" == "inet6" ]; then
+if [ "${2}" == "inet6" ]; then
# let the configuration system know that the ipv6 has changed.
- /bin/echo $4 |cut -d% -f1 > /tmp/$1_routerv6
- /bin/echo $3 |cut -d% -f1 > /tmp/$1_ipv6
- /usr/bin/touch /tmp/$1upv6
+ /bin/echo ${4} |cut -d% -f1 > /tmp/${1}_routerv6
+ /bin/echo ${3} |cut -d% -f1 > /tmp/${1}_ipv6
+ /usr/bin/touch /tmp/${1}upv6
ALLOWOVERRIDE=`/usr/bin/grep -c dnsallowoverride /conf/config.xml`
- if [ $ALLOWOVERRIDE -gt 0 ]; then
+ if [ ${ALLOWOVERRIDE} -gt 0 ]; then
# write nameservers to file
- if [ "`echo $6|grep -c dns1`" -gt 0 ]; then
- DNS1=`echo $6 |awk '{print $2}'`
- echo "$DNS1"> /var/etc/nameserver_v6$1
- /sbin/route change -inet6 "$DNS1" $4
+ if [ "`echo ${6}|grep -c dns1`" -gt 0 ]; then
+ DNS1=`echo ${6} |awk '{print ${2}}'`
+ echo "${DNS1}"> /var/etc/nameserver_v6${1}
+ /sbin/route change -inet6 "${DNS1}" ${4}
fi
- if [ "`echo $7|grep -c dns2`" -gt 0 ]; then
- DNS2=`echo $7 |awk '{print $2}'`
- echo "$DNS2" >> /var/etc/nameserver_v6$1
- /sbin/route change -inet6 "$DNS2" $4
+ if [ "`echo ${7}|grep -c dns2`" -gt 0 ]; then
+ DNS2=`echo ${7} |awk '{print ${2}}'`
+ echo "${DNS2}" >> /var/etc/nameserver_v6${1}
+ /sbin/route change -inet6 "${DNS2}" ${4}
fi
/usr/local/sbin/pfSctl -c 'service reload dns'
/bin/sleep 1
fi
fi
-/usr/local/sbin/pfSctl -c "interface newip $1"
+/usr/local/sbin/pfSctl -c "interface newip ${1}"
exit 0
OpenPOWER on IntegriCloud