Files
Domoticz/on_event_end.sh
2025-03-06 11:09:58 +01:00

21 lines
935 B
Bash
Executable File

#!/bin/bash
echo "Fin event" >>/home/souti/motion/detection.log
json="http://localhost:81/json.htm?type=command&param=udevice&idx=240&nvalue=0"
curl -s -i -H "Accept: application/json" $json >/dev/null
#presence=`curl "http://localhost:81/json.htm?type=devices&rid=183" 2>/dev/null|grep Status|grep "On"`
echo "Fin event envoi de mail $presence" >>/home/souti/motion/detection.log
echo "Detection de mouvement en absence " |mail -a `ls -rt /home/souti/motion/*avi | tail -1` -r souti@free.fr -s "Detection de mouvement" -- jerome.delacotte@gmail.com
#if [ "$presence" = "" ]; then
# echo "Fin event envoi de mail $presence" >>/home/souti/motion/detection.log
# echo "Detection de mouvement en absence " |mail -a `ls -rt /home/souti/motion/*avi | tail -1` -r souti@free.fr -s "Detection de mouvement" -- jerome.delacotte@gmail.com
#else
# echo "Fin event Pas d'envoi de mail $presence" >>/home/souti/motion/detection.log
#fi