Files
tools/linux/shack-open.sh

14 lines
295 B
Bash
Executable File

state=$(curl -s 'https://api.shackspace.de/v1/space' | w3m -dump -T text/html | tr '[}{]' '\n' | tr -d '"' | grep ^open | cut -d':' -f2)
if [ "$state" == 'true' ]
then
echo "Shack is OPEN"
elif [ "$state" == 'false' ]
then
echo "Shack is closed"
else
echo "Shack unknown State: $state"
fi