fix ppp unit number issues (#2178)
authorFelix Fietkau <nbd@openwrt.org>
Fri, 7 Sep 2007 13:09:17 +0000 (13:09 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 7 Sep 2007 13:09:17 +0000 (13:09 +0000)
SVN-Revision: 8665

package/ppp/files/ppp.sh

index 9f50e85ef2f589c816f20194589f6dfb949df19e..5ca1cf9c7d3ecf56eae4c6613ddeeb038791ceb8 100644 (file)
@@ -1,9 +1,12 @@
 scan_ppp() {
        config_get ifname "$1" ifname
        pppdev="${pppdev:-0}"
-       config_set "$1" ifname "ppp$pppdev"
-       config_set "$1" unit "$pppdev"
-       pppdev="$(($pppdev + 1))"
+       config_get unit "$1" unit
+       [ -z "$unit" ] && {
+               config_set "$1" ifname "ppp$pppdev"
+               config_set "$1" unit "$pppdev"
+               pppdev="$(($pppdev + 1))"
+       }
 }
 
 start_pppd() {