Created
December 8, 2019 13:50
-
-
Save gregbook/fb67900d45f6f16406c148d8e03c4918 to your computer and use it in GitHub Desktop.
Download multiple Docker Swarm UCP bundles
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/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