From 4e22257f106fbbbd24c63ade52cd4d625c3ee9fe Mon Sep 17 00:00:00 2001 From: bom Date: Mon, 31 Jan 2022 20:57:12 +0100 Subject: [PATCH] repaired create_admin script --- create_admin.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/create_admin.sh b/create_admin.sh index 7b811f7..2bd652f 100755 --- a/create_admin.sh +++ b/create_admin.sh @@ -1,3 +1,9 @@ #!/bin/bash -python3 mysite/manage.py shell -c "from django.contrib.auth.models import User; User.objects.create_superuser('admin', 'a@a.com', 'test1234')" +if [ $# != 4 ] +then + echo "expected 4 arguments (webserver-pod-name, username, email, password)" + exit -1 +fi + +kubectl exec $1 -- python3 manage.py shell -c "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('$2', '$3', '$4')"