[refactor] Move collect_webuser_inputs to so-functions

This commit is contained in:
William Wernert
2020-04-18 18:07:50 -04:00
parent 586d231ab1
commit 789173be98
2 changed files with 23 additions and 25 deletions

View File

@@ -291,6 +291,29 @@ clear_master() {
} }
collect_webuser_inputs() {
# Get a password for the web admin user
VALIDUSER=no
while [ $VALIDUSER != yes ]; do
whiptail_create_web_user
if so-user valemail "$WEBUSER"; then
VALIDUSER=yes
else
whiptail_invalid_user_warning
fi
done
WPMATCH=no
while [ $WPMATCH != yes ]; do
whiptail_create_web_user_password1
if echo "$WEBPASSWD1" | so-user valpass; then
whiptail_create_web_user_password2
check_web_pass
else
whiptail_invalid_pass_warning
fi
done
}
configure_minion() { configure_minion() {
# You have to pass the TYPE to this function so it knows if its a master or not # You have to pass the TYPE to this function so it knows if its a master or not

View File

@@ -249,31 +249,6 @@ if (whiptail_you_sure) ; then
fi fi
function collect_webuser_inputs() {
# Get a password for the web admin user
VALIDUSER=no
while [ $VALIDUSER != yes ]; do
whiptail_create_web_user
so-user valemail "$WEBUSER"
if [ $? == 0 ]; then
VALIDUSER=yes
else
whiptail_invalid_user_warning
fi
done
WPMATCH=no
while [ $WPMATCH != yes ]; do
whiptail_create_web_user_password1
echo "$WEBPASSWD1" | so-user valpass
if [ $? == 0 ]; then
whiptail_create_web_user_password2
check_web_pass
else
whiptail_invalid_pass_warning
fi
done
}
#################### ####################
## Master ## ## Master ##