X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=sbin%2Fnetcardconfig;h=37fd76135461f596faeb3404c31e7ac60c13010a;hb=6491538dd1b832fcae56d058b2a0685f2e643460;hp=40252b71425ad71822507cf4ac56e2bb6ef7cb28;hpb=bc56d430ed4f7eb77355cd3db871d7a7078d051b;p=grml-network.git diff --git a/sbin/netcardconfig b/sbin/netcardconfig index 40252b7..37fd761 100755 --- a/sbin/netcardconfig +++ b/sbin/netcardconfig @@ -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)" @@ -325,7 +327,13 @@ configiface() { } } ' /etc/network/interfaces) - $DIALOG --inputbox "$MESSAGEW23 $ESSID" 15 50 "$WPASECRET" 2>"$TMP" || bailout 1 + while [ -z "$WPASECRET" ] ; do + $DIALOG --inputbox "$MESSAGEW23 $ESSID" 15 50 "$WPASECRET" 2>"$TMP" || bailout 1 + read WPASECRET <"$TMP" + if [ -z "$WPASECRET" ] ; then + $DIALOG --msgbox "Sorry, empty password not allowed, please retry." 0 0 || bailout 1 + fi + done # make sure backslashes inside passphrase are handled correct WPASECRET=$(sed -e 's/\\/\\/g' "$TMP") && rm -r "$TMP" @@ -572,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