Skip to content

Instantly share code, notes, and snippets.

@gregbook
Created December 8, 2019 13:50
Show Gist options
  • Save gregbook/fb67900d45f6f16406c148d8e03c4918 to your computer and use it in GitHub Desktop.
Save gregbook/fb67900d45f6f16406c148d8e03c4918 to your computer and use it in GitHub Desktop.
Download multiple Docker Swarm UCP bundles
#!/bin/sh
# List of domains
UCP_DOMAINS=("")
read -s -p "Username LDAP: " username
echo '\n'
read -s -p "Please enter your password:" password
for url in ${UCP_DOMAINS[@]}; do
AUTHTOKEN=$(curl -sk -d '{"username":"'$username'","password":"'$password'"}' https://$url/auth/login | jq -r .auth_token)
curl -sk -H "Authorization: Bearer $AUTHTOKEN" https://$url/api/clientbundle -o $url-bundle.zip
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment