traewelling: dont require sync to be up

This commit is contained in:
Daniella / Tove 2024-10-28 21:50:26 +01:00
parent 4efc0b9cbe
commit 136a01ab8d
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -15,11 +15,13 @@ pkgs.writeShellScriptBin "traewelling" ''
user="$1"
fi
if ! [ -e ~/sync/traewelling.token ] ; then
exit
fi
#if ! [ -e ~/sync/traewelling.token ] ; then
# exit
#fi
json="$(curl -s -H "Authorization: $(cat ~/sync/traewelling.token)" "https://traewelling.de/api/v1/user/$user/statuses" | jq .data[0])"
json="$(curl -s \
#-H "Authorization: $(cat ~/sync/traewelling.token)" \
"https://traewelling.de/api/v1/user/$user/statuses" | jq .data[0])"
if [ "$(($(date -d "$(j .train.destination.arrival)" +%s) - $(date +%s) ))" -gt 0 ] ; then
color 9
echo "> Traewelling"