Skip to content

Commit c6c9ff7

Browse files
authored
skip user setup if provisioning
Signed-off-by: Daniel Hansson <[email protected]>
1 parent 0a5ec23 commit c6c9ff7

File tree

1 file changed

+33
-31
lines changed

1 file changed

+33
-31
lines changed

nextcloud_install_production.sh

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -511,42 +511,44 @@ download_script STATIC setup_secure_permissions_nextcloud
511511
bash "$SECURE" & spinner_loading
512512

513513
# Ask to set a custom username
514-
if yesno_box_no "Nextcloud is about to be installed.\nDo you want to change the standard GUI user '$GUIUSER' to something else?"
514+
if [ -z "$PROVISIONING" ]
515515
then
516-
while :
517-
do
518-
GUIUSER=$(input_box_flow "Please type in the name of the Web Admin in Nextcloud.
516+
if yesno_box_no "Nextcloud is about to be installed.\nDo you want to change the standard GUI user '$GUIUSER' to something else?"
517+
then
518+
while :
519+
do
520+
GUIUSER=$(input_box_flow "Please type in the name of the Web Admin in Nextcloud.
519521
\nThe only allowed characters for the username are:
520522
'a-z', 'A-Z', '0-9', and '_.@-'")
521-
if [[ "$GUIUSER" == *" "* ]]
522-
then
523-
msg_box "Please don't use spaces."
524-
# - has to be escaped otherwise it won't work.
525-
# Inspired by: https://unix.stackexchange.com/a/498731/433213
526-
elif [ "${GUIUSER//[A-Za-z0-9_.\-@]}" ]
527-
then
528-
msg_box "Allowed characters for the username are:\na-z', 'A-Z', '0-9', and '_.@-'\n\nPlease try again."
529-
else
530-
break
531-
fi
532-
done
533-
while :
534-
do
535-
GUIPASS=$(input_box_flow "Please type in the new password for the new Web Admin ($GUIUSER) in Nextcloud.")
536-
if [[ "$GUIPASS" == *" "* ]]
537-
then
538-
msg_box "Please don't use spaces."
539-
fi
540-
if [ "${GUIPASS//[A-Za-z0-9_.\-@]}" ]
541-
then
542-
msg_box "Allowed characters for the password are:\na-z', 'A-Z', '0-9', and '_.@-'\n\nPlease try again."
543-
else
544-
msg_box "The new Web Admin in Nextcloud is now: $GUIUSER\nThe password is set to: $GUIPASS
523+
if [[ "$GUIUSER" == *" "* ]]
524+
then
525+
msg_box "Please don't use spaces."
526+
# - has to be escaped otherwise it won't work.
527+
# Inspired by: https://unix.stackexchange.com/a/498731/433213
528+
elif [ "${GUIUSER//[A-Za-z0-9_.\-@]}" ]
529+
then
530+
msg_box "Allowed characters for the username are:\na-z', 'A-Z', '0-9', and '_.@-'\n\nPlease try again."
531+
else
532+
break
533+
fi
534+
done
535+
while :
536+
do
537+
GUIPASS=$(input_box_flow "Please type in the new password for the new Web Admin ($GUIUSER) in Nextcloud.")
538+
if [[ "$GUIPASS" == *" "* ]]
539+
then
540+
msg_box "Please don't use spaces."
541+
fi
542+
if [ "${GUIPASS//[A-Za-z0-9_.\-@]}" ]
543+
then
544+
msg_box "Allowed characters for the password are:\na-z', 'A-Z', '0-9', and '_.@-'\n\nPlease try again."
545+
else
546+
msg_box "The new Web Admin in Nextcloud is now: $GUIUSER\nThe password is set to: $GUIPASS
545547
This is used when you login to Nextcloud itself, i.e. on the web."
546548
break
547-
fi
548-
done
549-
549+
fi
550+
done
551+
fi
550552
fi
551553

552554
# Install Nextcloud

0 commit comments

Comments
 (0)