diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-03-19 15:52:27 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-03-19 15:52:27 -0300 |
commit | def432e6cc24916e193f8e473334a595e188d2e3 (patch) | |
tree | 664cf5ee28d1834ad1e78eaa85307c38f27b12e7 /usr/local/sbin/ppp-linkdown | |
parent | 46e27ea790e6f68fa648404a7159de1fa6746fe8 (diff) | |
download | pfsense-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-x | usr/local/sbin/ppp-linkdown | 6 |
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}: |