initial commit of bin scripts into git

This commit is contained in:
2023-11-08 13:38:19 +11:00
commit 3735eea3c6
113 changed files with 11631 additions and 0 deletions

23
hass_action.sh Executable file
View 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