Add create_user utility
This commit is contained in:
parent
d517468c09
commit
139d82c4a5
1 changed files with 25 additions and 0 deletions
25
distillery/utils/create_admin.sh
Normal file
25
distillery/utils/create_admin.sh
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# read user
|
||||||
|
USER=$1
|
||||||
|
if [ -z "$var" ]; then
|
||||||
|
echo "Usage: create_admin.sh USERNAME"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# read password
|
||||||
|
echo "Enter Password for $USER:"
|
||||||
|
read -s PASS
|
||||||
|
echo "Enter the same password again:"
|
||||||
|
read -s PASS2
|
||||||
|
|
||||||
|
if [ "$PASS" != "$PASS2" ]; then
|
||||||
|
echo "Passwords not equal"
|
||||||
|
exit 1
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# create the user and add the admin role
|
||||||
|
cd /var/www/data/project/
|
||||||
|
drush user:create "$USER" --password="$PASS"
|
||||||
|
drush user:add-role administrator "$USER"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue