Last active
January 14, 2017 22:14
-
-
Save emtii/284bdd86e04b8ef11d90b83a1c03b240 to your computer and use it in GitHub Desktop.
Creates backend user of given strings (=usernames) in array in Shopware 5 Apps.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# user to create | |
ARRAY=( | |
"emtii" | |
) | |
# iterate users | |
for (( i = 0; i < ${#ARRAY[@]}; ++i )); do | |
# create initial pass as unsalted md5 hash of user name, remove std out "-" info | |
MD5="$(echo -n ${ARRAY[i]} | md5sum | cut -d"-" -f1 -)" | |
# set values | |
EMAIL="${ARRAY[i]}@bestit-online.de" | |
USERNAME=${ARRAY[i]} | |
NAME="best it | ${ARRAY[i]}" | |
LOCALE="en_GB" | |
PASS=$MD5 | |
# create user | |
php ../bin/console sw:admin:create --email=$EMAIL --username=$USERNAME --name="$NAME" --locale=$LOCALE --password=$PASS --no-interaction | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment