Dialog while ks installation

Alexander Rau (private) alexander_rau at yahoo.com
Tue May 4 19:20:15 UTC 2004


Joern:

Here is what I did. Hope this helps

Example %post section %post
exec < /dev/tty3 > /dev/tty3
chvt 3

############################################################################
############################################################################
############ # Enter password with check if input is identical #
############################################################################
############################################################################
############

PASSWORD="&*UY^&^YI"
PASSWORD_CHECK=1

until [ "$PASSWORD" = "$PASSWORD_CHECK" ]
do
if [ $PASSWORD = "&*UY^&^YI" ] ; then

dialog --title "Enter root (Administrator) Password" --backtitle "MyDistro
(C) 2003 MyDistro" --no-cancel --passwordbox "Enter a root (Administrator)
password between 6 and 8 characters" 8 60 2>/tmp/passwd.$$

SEL=$?

NA5=`cat /tmp/passwd.$$`
case $SEL in
0) PASSWORD=$NA5;;
1) echo "Cancel is Pressed" ;;
255) echo "[ESCAPE] key pressed" ;;
esac

rm -f /tmp/passwd.$$

else

dialog --title "Passwords do not match" --backtitle "MyDistro (C) 2003
MyDistro" --msgbox "The passwords you entered do not match. Please re-enter
passwords" 6 50

dialog --title "Enter root (Administrator) Password" --backtitle "MyDistro
(C) 2003 MyDistro" --no-cancel --passwordbox "Enter a root (Administrator)
password between 6 and 8 characters" 8 60 2>/tmp/passwd.$$

SEL=$?

NA5=`cat /tmp/passwd.$$`
case $SEL in
0) PASSWORD=$NA5;;
1) echo "Cancel is Pressed" ;;
255) echo "[ESCAPE] key pressed" ;;
esac

rm -f /tmp/passwd.$$

fi

dialog --title "Re-enter root (Administrator) Password" --backtitle
"MyDistro (C) 2003 MyDistro" --no-cancel --passwordbox "Please re-enter the
root (Administrator) password" 8 60 2>/tmp/passwd.$$

SEL=$?

NA4=`cat /tmp/passwd.$$`
case $SEL in
0) PASSWORD_CHECK=$NA4;;
1) echo "Cancel is Pressed" ;;
255) echo "[ESCAPE] key pressed" ;;
esac

rm -f /tmp/passwd.$$

done

echo $NA4 | passwd --stdin root >/dev/null 2>&1

############################################################################
############################################################################
############

############################################################################
############################################################################
############ # Enter Username #
############################################################################
############################################################################
############

dialog --title "Add Username" --backtitle "MyDistro (C) 2003 MyDistro"
--no-cancel --inputbox "Enter an easy to remember Username please" 8 60
2>/tmp/usrname.$$

SEL=$?

NA=`cat /tmp/usrname.$$`
case $SEL in
0) useradd $NA >/dev/null 2>&1 ;;
1) echo "Cancel is Pressed" ;;
255) echo "[ESCAPE] key pressed" ;;
esac

rm -f /tmp/usrname.$$

############################################################################
############################################################################
############

############################################################################
############################################################################
############ # Enter Real Name #
############################################################################
############################################################################
############

dialog --title "Enter Name" --backtitle "MyDistro (C) 2003 MyDistro"
--no-cancel --inputbox "Please enter your real name(first and last)" 8 60
2>/tmp/name.$$

SEL=$?

NA2=`cat /tmp/name.$$`
case $SEL in
0) chfn -f "$NA2" $NA >/dev/null 2>&1 ;;
1) echo "Cancel is Pressed" ;;
255) echo "[ESCAPE] key pressed" ;;
esac

rm -f /tmp/name.$$

############################################################################
############################################################################
############

############################################################################
############################################################################
############ # Enter password with check if input is identical #
############################################################################
############################################################################
############

PASSWORD="&*UY^&^YY"
PASSWORD_CHECK=1
until [ "$PASSWORD" = "$PASSWORD_CHECK" ]
do
if [ $PASSWORD = "&*UY^&^YY" ] ; then

dialog --title "Enter Password" --backtitle "MyDistro (C) 2003 MyDistro"
--no-cancel --passwordbox "Enter a password between 6 and 8 characters" 8 60
2>/tmp/passwd.$$

SEL=$?

NA1=`cat /tmp/passwd.$$`
case $SEL in
0) PASSWORD=$NA1;;
1) echo "Cancel is Pressed" ;;
255) echo "[ESCAPE] key pressed" ;;
esac

rm -f /tmp/passwd.$$

else

dialog --title "Password's do not match" --backtitle "MyDistro (C) 2003
MyDistro" --msgbox "The passwords you entered do not match. Please re-enter
passwords" 6 50

dialog --title "Enter Password" --backtitle "MyDistro (C) 2003 MyDistro"
--no-cancel --passwordbox "Enter a password between 6 and 8 characters" 8 60
2>/tmp/passwd.$$

SEL=$?

NA1=`cat /tmp/passwd.$$`
case $SEL in
0) PASSWORD=$NA1;;
1) echo "Cancel is Pressed" ;;
255) echo "[ESCAPE] key pressed" ;;
esac

rm -f /tmp/passwd.$$

fi

dialog --title "Re-enter Password" --backtitle "MyDistro (C) 2003 MyDistro"
--no-cancel --passwordbox "Please re-enter your password" 8 60
2>/tmp/passwd.$$

SEL=$?

NA3=`cat /tmp/passwd.$$`
case $SEL in
0) PASSWORD_CHECK=$NA3;;
1) echo "Cancel is Pressed" ;;
255) echo "[ESCAPE] key pressed" ;;
esac

rm -f /tmp/passwd.$$

done

echo $NA3 | passwd --stdin $NA >/dev/null 2>&1

############################################################################
############################################################################
############

############################################################################
############################################################################
############ # Thank you #
############################################################################
############################################################################
############

dialog --title "Thank you" --backtitle "MyDistro (C) 2003 MyDistro" --msgbox
"Thank you for choosing and installing MyDistro. Please press to reboot
system and start MyDistro. Please remove any floppy disks and/or CD-ROMS
from their respective drives." 9 50

############################################################################
############################################################################
############

chvt 3

-----Original Message-----
From: kickstart-list-bounces at redhat.com
[mailto:kickstart-list-bounces at redhat.com] On Behalf Of Jörn Rink
Sent: Tuesday, May 04, 2004 2:25 AM
To: Discussion list about Kickstart
Subject: Dialog while ks installation

Hi,
anyone has experience with making dialogs for a user
for a kickstart installation? I made this in the past for
SuSE 7.x and the auto installation via yast.
There i have to use some tricks to manage a dialog for the user.

For fedora i have the text install option, where i can use dialog or the
x install option, where i could use xdialog.

CU
 Joern Rink

-- 
Nine (not 9)
Never trust a hippie


_______________________________________________
Kickstart-list mailing list
Kickstart-list at redhat.com
https://www.redhat.com/mailman/listinfo/kickstart-list





More information about the Kickstart-list mailing list