Created
December 7, 2016 18:18
-
-
Save Fensterbank/d2872c34c6c2f45f87632a8e8a10e3e4 to your computer and use it in GitHub Desktop.
Creates random nextcloud users by using RandomAPI and nextclouds provisioning API
This file contains 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 | |
for person in `curl "https://randomuser.me/api/?format=csv&nat=de&inc=name&results=2000" -s -X GET`; do | |
IFS=',' read -r -a array <<< "$person" | |
if [ ${array[1]} != "name.first" ]; then | |
echo "Create ${array[1]} ${array[2]}" | |
curl "https://adminuser:password@domain.tld/ocs/v1.php/cloud/users" -X POST -s -d userid="${array[1]} ${array[2]}" -d password="password1433" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment