2015-05-11 00:28:03 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# put into /root/.ssh/authorized_keys this:
|
|
|
|
# command="/root/pidor/scripts/doorbuzz_wrapper.sh" ssh-rsa AAAAB3.......................7fEbKbG2UcaO4d0YZ67T pi@doorbuzz
|
|
|
|
|
|
|
|
while read cmd
|
|
|
|
do
|
|
|
|
if [ "$cmd" = "spacestatus" ]
|
|
|
|
then
|
|
|
|
cat /var/run/spacestatus
|
|
|
|
fi
|
2016-04-18 22:06:28 +02:00
|
|
|
if [ "$cmd" = "peoplecounter" ]
|
|
|
|
then
|
2017-03-15 16:13:03 +01:00
|
|
|
tail -1 /run/presencyrt
|
2016-04-18 22:06:28 +02:00
|
|
|
fi
|
2015-05-11 00:28:03 +02:00
|
|
|
|
|
|
|
if [ "$cmd" = "flashon" ]
|
|
|
|
then
|
|
|
|
logger -t $(basename $0) "phone status change detected"
|
|
|
|
logger -t $(basename $0) "phone ring light on"
|
2015-07-19 22:30:46 +02:00
|
|
|
$(dirname "$0")/lightcommander alarm on >&2
|
|
|
|
#/usr/local/bin/433send 2 15 1 1 >&2
|
2015-05-11 00:28:03 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$cmd" = "flashoff" ]
|
|
|
|
then
|
|
|
|
logger -t $(basename $0) "phone status change detected"
|
|
|
|
logger -t $(basename $0) "phone ring light off"
|
2015-07-19 22:30:46 +02:00
|
|
|
$(dirname "$0")/lightcommander alarm off >&2
|
|
|
|
#/usr/local/bin/433send 2 15 1 0 >&2
|
2015-05-11 00:28:03 +02:00
|
|
|
fi
|
|
|
|
done
|