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
|
|
|
|
|
|
|
|
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
|