Skip to content

Commit

Permalink
Fix 'one liner' in docker-entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-powl committed Mar 20, 2020
1 parent edd9c61 commit 0b4cd83
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ python manage.py migrate
# Check for first install
if [ ! -f status.created ]; then
# Create the default admin user
echo "[+] Create the default admin user"
# echo "\
#from django.contrib.auth import get_user_model; \
#User = get_user_model(); \
#User.objects.create_superuser('admin', 'admin@dev.patrowl.io', 'Bonjour1!') if User.objects.count() == 0 else pass" | python manage.py shell
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('admin', 'admin@dev.patrowl.io', 'Bonjour1!')" | python manage.py shell
echo "[+] Create the default admin user (if needeed)"
# Be careful with Python identation and echo command
echo -e "from django.contrib.auth import get_user_model\r\
User = get_user_model()\r\
if not User.objects.filter(username='admin').exists(): User.objects.create_superuser('admin', 'admin@dev.patrowl.io', 'Bonjour1!')" | python manage.py shell

# Populate the db with default data
echo "[+] Populate the db with default data"
Expand Down

0 comments on commit 0b4cd83

Please sign in to comment.