shutdown interface before reconfiguring it
authorChristian Hofstaedtler <ch@grml.org>
Thu, 9 Dec 2010 17:16:20 +0000 (18:16 +0100)
committerChristian Hofstaedtler <ch@grml.org>
Thu, 9 Dec 2010 17:16:20 +0000 (18:16 +0100)
shutting down the interface before reconfiguring it ensures that previously
started dhclients and other programs exit and do not interfere with the new
configuration.

sbin/netcardconfig

index f0429c8..37fd761 100755 (executable)
@@ -156,6 +156,8 @@ configiface() {
   DEVICE=${NETDEVICES[$DV]}
   device2props
   DV=$DEVICENAME
+  ifdown $DV
+  sleep 3
   # wireless config
   WLDEVICE="$(LANG=C LC_MESSAGEWS=C iwconfig $DV 2>/dev/null | awk '/802\.11|READY|ESSID/{print $1}')"
   WLDEVICECOUNT="$(LANG=C LC_MESSAGEWS=C iwconfig $DV 2>/dev/null | wc -l)"
@@ -578,8 +580,6 @@ while (true); do
   IFACEDONE=""
   while [ -n "$DV" -a -z "$IFACEDONE" ]; do
     configiface
-    ifdown $DV
-    sleep 3
     if ! ifup $DV; then
       $DIALOG --yesno "$MESSAGE14" 15 50 || IFACEDONE="DONE"
     else