# 21-addpass
# prompt and set password for admin user

PWusr="hybadmin"
DefPW="WebG@tew@y#" # default hybadmin password for auto-firstboot
MANUAL_BACK=0

if [ -n "$AUTOINST" ] ; then
	# auto-firstboot: no prompt, fixed default password
	P1="$DefPW"
else
	# manual-firstboot: prompt user for hybadmin password
	while(true) ; do
		GetPW || {
			if [ "$MANUAL_BACK" = "1" ] ; then
				BACK_TO="05-autoinst"
				return 1
			fi
		}
		[ "$P1" == "$DefPW" ] && break
		ChkPW && break
	done
fi

SetPW # set password in system
unset P1 P2 LEN PWusr
wipefiles $tempfile

