grub-md5-crypt would be more useful if it could be used in scripts like
this:
        md5passwd=`grub-md5-crypt`
        if [ $? -eq 0 ]; then
                echo "password --md5 $md5passwd" >> /boot/grub/menu.lst
        fi

this is not possible in grub-0.93 because the password prompts are
sent to standard out. sending them to standard error allows this.

-- 
 J.F.Carter                       http://www.jfc.org.uk/
--- /usr/sbin/grub-md5-crypt    2003-05-19 17:56:47.000000000 +0100
+++ /tmp/grub-md5-crypt 2003-08-06 11:50:22.000000000 +0100
@@ -53,9 +53,9 @@
        ;;
 
     *)
-       echo "$progname: unrecognized option \`$option'"
-       echo "Usage: $progname [OPTION]"
-       echo "Try \`$progname --help' for more information."
+       echo "$progname: unrecognized option \`$option'" 1>&2
+       echo "Usage: $progname [OPTION]" 1>&2
+       echo "Try \`$progname --help' for more information." 1>&2
        exit 1
        ;;
     esac
@@ -65,25 +65,25 @@
 stty -echo
 
 # Prompt to enter a password.
-echo -n "Password: "
+echo -n "Password: " 1>&2
 read -r password
-echo
+echo 1>&2
 
 # One more time.
-echo -n "Retype password: "
+echo -n "Retype password: " 1>&2
 read -r password2
-echo
+echo 1>&2
 
 # Resume echo backs.
 stty echo
 
 if test "x$password" = x; then
-    echo "Empty password is not permitted."
+    echo "Empty password is not permitted." 1>&2
     exit 1
 fi
 
 if test "x$password" != "x$password2"; then
-    echo "Sorry, passwords do not match."
+    echo "Sorry, passwords do not match." 1>&2
     exit 1
 fi
 
_______________________________________________
Bug-grub mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-grub

Reply via email to