Query Zeus Tab status from the command line

This commit is contained in:
Felix Van der Jeugt 2020-01-02 13:28:05 +01:00
parent 696baa2d76
commit aee545d2b9
No known key found for this signature in database
GPG Key ID: 58B209295023754D
1 changed files with 14 additions and 0 deletions

14
local/bin/zeustab Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
base='https://tab.zeus.gent'
user='felixvdj'
token="$(pass show ugent/zeus/tab)"
query="$base/users/$user.json"
[ "$1" = "hist" ] && query="$base/users/$user/transactions.json"
curl --header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "Authorization: Token token=$token" \
--location \
"$query"