[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. 0.6-54-ge787d4f

Andreas B. Mundt andi at debian.org
Sun Nov 4 12:24:27 UTC 2012


The following commit has been merged in the master branch:
commit e787d4fbf99d03c4734c92e2dd460b6bb16cc3e1
Author: Andreas B. Mundt <andi at debian.org>
Date:   Sat Nov 3 09:37:40 2012 +0100

    Use 'dialog' to prompt for the root password.

diff --git a/fai/config/hooks/install.DEFAULT.source b/fai/config/hooks/install.DEFAULT.source
index 8352430..fd1baa5 100755
--- a/fai/config/hooks/install.DEFAULT.source
+++ b/fai/config/hooks/install.DEFAULT.source
@@ -4,24 +4,20 @@
 #
 
 if [ -n "$ROOTPW" ] ; then
-    echo "Root password is set."
+    echo "Root password hash is set."
 else
-    cat <<EOF
-================================================================================
-
-There is no root password available.
-
-EOF
     while [ -z "$ROOTPW" ] ; do
-        read -serp "   Please enter your root password: " inp1
-        echo
-        read -serp "   Please enter your root password again: " inp2
-        echo
-        if [ "$inp1" == "$inp2" ] ; then
-            ROOTPW=`mkpasswd -Hsha-256 "$inp1"`
-            echo "Password for root set."
+        if ! { inp1=$(dialog --insecure --stdout --backtitle " Root Password " --passwordbox \
+	    "There is no password hash for root available. \nPlease enter a root password:" 10 49) &&
+		inp2=$(dialog --insecure --stdout --backtitle " Root Password " --passwordbox \
+		    "Please enter the root password again:" 9 41); } ; then
+            dialog --stdout --msgbox "Entering passwords canceled, please try again." 5 50
+        elif [ "$inp1" == "$inp2" ] ; then
+	    ROOTPW=`mkpasswd -Hsha-256 "$inp1"`
+            echo "Password hash for root set."
         else
-            echo -e "\nPasswords do not match, please try again.\n"
+            dialog --stdout --msgbox "Passwords do not match, please try again." 5 45
         fi
+	unset inp1 inp2
     done
 fi

-- 
Debian-LAN development and packaging



More information about the debian-lan-devel mailing list