summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin/ppp-linkdown
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-03-19 15:52:27 -0300
committerRenato Botelho <garga@FreeBSD.org>2013-03-19 15:52:27 -0300
commitdef432e6cc24916e193f8e473334a595e188d2e3 (patch)
tree664cf5ee28d1834ad1e78eaa85307c38f27b12e7 /usr/local/sbin/ppp-linkdown
parent46e27ea790e6f68fa648404a7159de1fa6746fe8 (diff)
downloadpfsense-def432e6cc24916e193f8e473334a595e188d2e3.zip
pfsense-def432e6cc24916e193f8e473334a595e188d2e3.tar.gz
Make sure file has content before call route delete
Diffstat (limited to 'usr/local/sbin/ppp-linkdown')
-rwxr-xr-xusr/local/sbin/ppp-linkdown6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/local/sbin/ppp-linkdown b/usr/local/sbin/ppp-linkdown
index 54807ac..62d07ed 100755
--- a/usr/local/sbin/ppp-linkdown
+++ b/usr/local/sbin/ppp-linkdown
@@ -10,8 +10,10 @@ fi
/etc/rc.kill_states ${IF} ${LOCAL_IP}
-if [ -f "/tmp/${IF}_defaultgw" ]; then
- /sbin/route delete default `/usr/bin/head -n 1 /tmp/${IF}_defaultgw`;
+if [ -s "/tmp/${IF}_defaultgw" ]; then
+ GW=`head -n 1 /tmp/${IF}_defaultgw`
+ [ -n "${GW}" ] \
+ && /sbin/route delete default ${GW}
fi
# delete the node just in case mpd cannot do that
/usr/sbin/ngctl shutdown ${IF}:
OpenPOWER on IntegriCloud