[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, squeeze, updated. 0.6-35-g5748cf8

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


The following commit has been merged in the squeeze branch:
commit 5748cf86a90a3951e5fb48e9a2a5c12c52c1db8f
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.
    (cherry picked from commit e787d4fbf99d03c4734c92e2dd460b6bb16cc3e1)

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