From 7e8b185f1d5705ca80c87fa5d5b8ac3ff699c42c Mon Sep 17 00:00:00 2001 From: Yoann Vandoorselaere Date: Mon, 29 Nov 1999 15:06:21 +0000 Subject: *** empty log message *** --- init-sh/lib.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'init-sh/lib.sh') diff --git a/init-sh/lib.sh b/init-sh/lib.sh index 578c4e4..81c62c0 100644 --- a/init-sh/lib.sh +++ b/init-sh/lib.sh @@ -26,6 +26,15 @@ fi USERNAME="blah" COMMENT="# Mandrake-Security : if you remove this comment, remove the next line too." +WaitAnswer() { + answer="nothing" + + while [[ "${answer}" != "yes" && "${answer}" != "no" ]]; do + echo -n "yes/no : " + read answer + done +} + AddRules () { string=$1 file=$2 @@ -113,9 +122,8 @@ LiloUpdate() { echo "Do you want a password authentication at boot time ?" echo "Be very carefull," echo "this will prevent your server to reboot without an operator to enter password". - echo -n "[yes]/no : " - read answer - if [[ "${answer}" == "yes" || "${answer}" == "" ]]; then + WaitAnswer + if [ "${answer}" == "yes" ]; then echo -n "Please enter the password which will be used at boot time : " read password else @@ -131,9 +139,10 @@ LiloUpdate() { if ! echo "${line}" | grep -q "password"; then echo "${line}" >> /etc/lilo.conf fi - done < /etc/secure.tmp + done < /tmp/secure.tmp - rm -f /etc/secure.tmp + rm -f /tmp/secure.tmp + clear AddRules "password=$PASSWORD" /etc/lilo.conf fi } -- cgit v1.2.1