Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Commit

Permalink
fix login check
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhemmarchand committed Aug 6, 2020
1 parent 7fa3f41 commit 6733bec
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions appinspect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ export appinspect_token=$(curl -X GET \
-u ${username} \
--url "https://api.splunk.com/2.0/rest/login/splunk" -s | sed 's/%//g' | jq -r .data.token)

if [ $? -ne 0 ]; then
echo "ERROR: login to appinspect API has failed, an authentication could be not be generated."; exit 1
else
case "$appinspect_token" in
"null")
echo "ERROR: login to appinspect API has failed, an authentication token could be not be generated."; exit 1
;;
*)
echo "SUCCESS: Authentication was successful and we got a token."
fi
;;
esac

for app in $(ls *.tgz); do

Expand Down

0 comments on commit 6733bec

Please sign in to comment.