Browse Source

handle empty variables in network script

Waldemar Brodkorb 13 years ago
parent
commit
4b4db585a4
2 changed files with 7 additions and 4 deletions
  1. 1 1
      package/ppp/Makefile
  2. 6 3
      package/ppp/files/ppp.pre-up

+ 1 - 1
package/ppp/Makefile

@@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		ppp
 PKG_VERSION:=		2.4.5
-PKG_RELEASE:=		4
+PKG_RELEASE:=		5
 PKG_MD5SUM:=		4621bc56167b6953ec4071043fe0ec57
 PKG_DESCR:=		Point-to-Point Protocol software
 PKG_SECTION:=		ppp

+ 6 - 3
package/ppp/files/ppp.pre-up

@@ -11,11 +11,14 @@
 }
 
 IDLEOPTIONS="persist\nmaxfail 0"
-if [ "$IF_PPP_IDLETIME" -gt 0 ]; then
+[ "$IF_PPP_IDLETIME" ] && {
+  if [ "$IF_PPP_IDLETIME" -gt 0 ]; then
 	IDLEOTPIONS="idletime $IF_PPP_IDLETIME"
-fi
+  fi
+}
 
-if [ "$IF_PPP_MTU" -gt 0 ] ; then 
+[ "$IF_PPP_MTU" ] || IF_PPP_MTU=1412
+if [ "$IF_PPP_MTU" -gt 0 ] ; then
 	NETWORKOPTIONS="mtu $IF_PPP_MTU\nmru $IF_PPP_MTU"
 fi