Drop commands out onto lines
This commit is contained in:
parent
0a06ff5c74
commit
d39ddd9a72
@ -11,11 +11,27 @@ setup_root_user() {
|
||||
return
|
||||
fi
|
||||
|
||||
user_count=$(mysql -u"${DB_USER}" -p"${DB_PASSWD}" -h "${DOKKU_MARIADB_GITEA_PORT_3306_TCP_ADDR}" --database="${DB_NAME}" -N -B -e "SELECT count(*) FROM user;")
|
||||
user_count=$(mysql \
|
||||
-u"${DB_USER}" \
|
||||
-p"${DB_PASSWD}" \
|
||||
-h "${DOKKU_MARIADB_GITEA_PORT_3306_TCP_ADDR}" \
|
||||
--database="${DB_NAME}" \
|
||||
-N -B -e "SELECT count(*) FROM user;" \
|
||||
)
|
||||
|
||||
if [[ "${user_count}" == "0" ]]; then
|
||||
echo "-----> Setting up root user for initial deployment"
|
||||
if gitea admin create-user --username "$ADMIN_USER" --password "$ADMIN_PASS" --email "$ADMIN_MAIL" --admin; then
|
||||
|
||||
create_user=$(gitea \
|
||||
admin \
|
||||
create-user \
|
||||
--username "$ADMIN_USER" \
|
||||
--password "$ADMIN_PASS" \
|
||||
--email "$ADMIN_MAIL" \
|
||||
--admin \
|
||||
)
|
||||
|
||||
if "$create_user"; then
|
||||
echo "-----> root user added"
|
||||
else
|
||||
echo "-----> Failed to add root user"
|
||||
|
Reference in New Issue
Block a user