Last active
September 22, 2018 00:05
-
-
Save reidstidolph/3831b54bf00b425c6dcd2cd980a9eba2 to your computer and use it in GitHub Desktop.
Simple bash script for retrieving a 128T API token.
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 | |
read -p '128T host address (press enter for localhost): ' ADDRESS | |
if [[ -z "$ADDRESS" ]]; then | |
ADDRESS="127.0.0.1" | |
fi | |
read -p 'Username: ' USER | |
read -s -p 'Password (hidden): ' PASS | |
echo | |
echo Retrieving token... | |
echo | |
curl -X POST -H 'Content-Type: application/json' -d "{\"username\": \"$USER\", \"password\": \"$PASS\"}" -k https://$ADDRESS/api/v1/login | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment