- ROOTPW1='PW1'
- ROOTPW2='PW2'
- while [ "$ROOTPW1" != "$ROOTPW2" ]; do
- ROOTPW1=$(dialog --insecure --stdout --title "${PN}" --passwordbox \
- "Please enter the password for the root account:" 10 60)
- [ $? -eq 0 ] || bailout
- ROOTPW2=$(dialog --insecure --stdout --title "${PN}" --passwordbox \
- "Please enter the password for the root account again for \
- confirmation:" 10 60)
- [ $? -eq 0 ] || bailout
-
- if [ "$ROOTPW1" != "$ROOTPW2" ]; then
- $(dialog --stdout --title "${PN}" --ok-label \
- "Retry" --msgbox "Passwords do not match!" 10 60)
- fi
- done
- ROOTPASSWORD="$ROOTPW1"
+ if [ "$_opt_nopassword" ] ; then
+ einfo "Skip asking for root password as requested."
+ return 0
+ fi
+
+ ROOTPW1='PW1'
+ ROOTPW2='PW2'
+ while [ "$ROOTPW1" != "$ROOTPW2" ]; do
+ ROOTPW1=$(dialog --insecure --stdout --title "${PN}" --passwordbox \
+ "Please enter the password for the root account:" 10 60)
+ [ $? -eq 0 ] || bailout
+ ROOTPW2=$(dialog --insecure --stdout --title "${PN}" --passwordbox \
+ "Please enter the password for the root account again for \
+ confirmation:" 10 60)
+ [ $? -eq 0 ] || bailout
+
+ if [ "$ROOTPW1" != "$ROOTPW2" ]; then
+ $(dialog --stdout --title "${PN}" --ok-label \
+ "Retry" --msgbox "Passwords do not match!" 10 60)
+ fi
+ done
+ ROOTPASSWORD="$ROOTPW1"