dotfiles/.bin/OLD/stromgedacht.sh
2024-02-14 07:55:58 +01:00

23 lines
346 B
Bash
Executable File

#!/bin/sh
PLZ=$1
PLZ=${PLZ:=68766}
STATE=$(curl -s -X GET -H "accept":"application/json" \
https://api.stromgedacht.de/v1/now?zip=$PLZ | jq -rc .state)
case $STATE in
-1) echo "superGreen"
;;
1) echo "Green"
;;
3) echo "Green"
;;
4) echo "Green"
;;
*) echo "Unkown state code: $STATE"
;;
esac