- $DIALOG --inputbox "$MESSAGEW23 $ESSID" 15 50 "$WPASECRET" 2>"$TMP" || bailout 1
-
- # make sure backslashes inside passphrase are handled correct
- WPASECRET=$(sed -e 's/\\/\\/g' "$TMP") && rm -r "$TMP"
+ FIRST_RUN=0 # show the wpasecret input box at least once
+ while ( [ -z "$WPASECRET" ] || [ "$FIRST_RUN" ] ) ; 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
+ FIRST_RUN=""
+ done
+
+ rm -f "$TMP"