Last active
June 27, 2018 19:41
-
-
Save HokieGeek/b0078e2b1227bea6ff7fdfb64b849b90 to your computer and use it in GitHub Desktop.
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 | |
license=$1 | |
iq_host=${2:-"localhost:8070"} | |
user_pwd=${3:-"admin:admin123"} | |
echo "Installing to ${iq_host}" | |
cookies="cookies" | |
## Create session | |
curl --verbose \ | |
--user ${user_pwd} \ | |
--cookie-jar ${cookies} --cookie ${cookies} \ | |
"http://${iq_host}/rest/user/session" | |
curl --verbose \ | |
--user ${user_pwd} \ | |
--cookie-jar ${cookies} --cookie ${cookies} \ | |
--header "X-CSRF-TOKEN: $(awk '/CLM-CSRF-TOKEN/ { print $NF }' ${cookies})" \ | |
--form "file=@${license}" \ | |
"http://${iq_host}/rest/product/license" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment