mirror of
https://github.com/librenms/docker.git
synced 2026-01-23 02:14:48 +00:00
Enable the First Run Wizard (#280)
Use the first run wizard instead of creating an admin user with a known password.
This commit is contained in:
parent
ee333d4357
commit
7cf09447a5
2 changed files with 8 additions and 11 deletions
|
|
@ -69,7 +69,13 @@ while ! ${dbcmd} -e "show databases;" >/dev/null 2>&1; do
|
|||
fi
|
||||
done
|
||||
echo "Database ready!"
|
||||
|
||||
# Enable first run wizard if db is empty
|
||||
counttables=$(echo 'SHOW TABLES' | ${dbcmd} "$DB_NAME" | wc -l)
|
||||
if [ "${counttables}" -eq "0" ]; then
|
||||
echo "Enabling First Run Wizard..."
|
||||
echo "INSTALL=user,finish">> ${LIBRENMS_PATH}/.env
|
||||
fi
|
||||
|
||||
echo "Updating database schema..."
|
||||
lnms migrate --force --no-ansi --no-interaction
|
||||
|
|
@ -79,11 +85,6 @@ echo "Clear cache"
|
|||
artisan cache:clear --no-interaction
|
||||
artisan config:cache --no-interaction
|
||||
|
||||
if [ "${counttables}" -eq "0" ]; then
|
||||
echo "Creating admin user..."
|
||||
lnms user:add --password=librenms --email=librenms@librenms.docker --role=admin --no-ansi --no-interaction librenms
|
||||
fi
|
||||
|
||||
mkdir -p /etc/services.d/nginx
|
||||
cat >/etc/services.d/nginx/run <<EOL
|
||||
#!/usr/bin/execlineb -P
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue