initial commit of bin scripts into git
This commit is contained in:
23
hass_action.sh
Executable file
23
hass_action.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
## data passed from incron:
|
||||
# $1 dir being watched
|
||||
# $2 file name created in $1
|
||||
|
||||
LOG=/home/ddp/log/hassio-incron.log
|
||||
WHEN=`date +'%H:%M:%S %d-%m-%y'`
|
||||
if [ "$2" = "notify.txt" ]; then
|
||||
str=`cat $1/$2`
|
||||
tv=`host tv.ddp.net | awk ' { print $4 } '`
|
||||
/usr/bin/mythutil --message --message_text "$str" --timeout 3 --bcastaddr=$tv
|
||||
echo "$WHEN: Sent message: $str to myth running on tv" >> $LOG
|
||||
elif [ "$2" = "netatmo.txt" ]; then
|
||||
mode=`cat $1/$2`
|
||||
echo "$WHEN: netatmo starting to set to: $mode" >> $LOG
|
||||
/home/ddp/bin/sec_light.py $mode
|
||||
echo "$WHEN: netatmo finished set to: $mode" >> $LOG
|
||||
else
|
||||
echo "$WHEN: UNKNOWN ACTION: $2" >> $LOG
|
||||
fi
|
||||
sudo rm $1/$2
|
||||
Reference in New Issue
Block a user