Intial checkin, shack-open.sh
This commit is contained in:
13
linux/shack-open.sh
Executable file
13
linux/shack-open.sh
Executable file
@@ -0,0 +1,13 @@
|
||||
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user