Skip to content

Instantly share code, notes, and snippets.

@tbhaxor
Created March 24, 2021 23:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tbhaxor/94337f4df05adea1453a926060a72ddf to your computer and use it in GitHub Desktop.
Save tbhaxor/94337f4df05adea1453a926060a72ddf to your computer and use it in GitHub Desktop.
Gunicorn token authentication
cat $1 | while read TOKEN; do
content=$(curl -s -H "Authorization: Token $TOKEN" $2)
if echo $content | grep -qi unauth; then continue
else echo $content; break; exit 0
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment