Skip to content

Instantly share code, notes, and snippets.

@Fensterbank
Created December 7, 2016 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fensterbank/d2872c34c6c2f45f87632a8e8a10e3e4 to your computer and use it in GitHub Desktop.
Save Fensterbank/d2872c34c6c2f45f87632a8e8a10e3e4 to your computer and use it in GitHub Desktop.
Creates random nextcloud users by using RandomAPI and nextclouds provisioning API
#!/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