ask if root password should be changed

This commit is contained in:
DeltaLima 2023-10-23 12:23:32 +02:00
parent f92e632b0a
commit 1eb344ffd3

View file

@ -177,8 +177,27 @@ while [ $STEPFINISH != 1 ]
do do
case $USERSTEP in case $USERSTEP in
u|U) u|U)
message "please change root pw"
$CHROOTCMD /usr/bin/passwd root || error CONTINUESTEP=false
while [ CONTINUESTEP == false ]
do
message "Do you want to set a password for '${RED}root${ENDCOLOR}'?"
read -p "[y/n] > " ROOTPASSCHANGE
case ${ROOTPASSCHANGE,,} in
y|yes)
message "please change root pw"
$CHROOTCMD /usr/bin/passwd root || error
CONTINUESTEP=true
;;
n|no()
message "leaving root password empty"
CONTINUESTEP=true
;;
*)
message warn "Unrecognized answers, please try again..."
;;
esac
message "deleting user 'debian'" message "deleting user 'debian'"
$CHROOTCMD /usr/bin/id -u debian && $CHROOTCMD /usr/sbin/userdel -f debian || error $CHROOTCMD /usr/bin/id -u debian && $CHROOTCMD /usr/sbin/userdel -f debian || error