Skip to content

Instantly share code, notes, and snippets.

@emtii
Last active January 14, 2017 22:14
Show Gist options
  • Save emtii/284bdd86e04b8ef11d90b83a1c03b240 to your computer and use it in GitHub Desktop.
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.
#!/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