1
0
mirror of https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks.git synced 2025-09-02 20:52:41 +02:00

Allow custom scripts to run on motion detection on/off (#432)

* Allow custom scripts to run on motion detection on/off

* Custom user scripts should be ignored
This commit is contained in:
Dopeyr
2018-06-08 01:36:03 +01:00
committed by jmtatsch
parent f9430ebeae
commit 6ecaeef08e
4 changed files with 17 additions and 0 deletions

1
.gitignore vendored
View File

@@ -56,4 +56,5 @@ firmware_mod/config/rtspserver.conf
firmware_mod/config/ntp_srv.conf
firmware_mod/config/lighttpd.user
firmware_mod/config/lighttpd.pem
firmware_mod/config/userscripts/*/*
firmware_mod/root/.ssh/*

View File

@@ -14,3 +14,11 @@ if [ "$publish_mqtt_message" = true ] ; then
. /system/sdcard/config/mqtt.conf
/system/sdcard/bin/mosquitto_pub.bin -h "$HOST" -p "$PORT" -u "$USER" -P "$PASS" -t "${TOPIC}"/motion ${MOSQUITTOOPTS} ${MOSQUITTOPUBOPTS} -m "OFF"
fi
# Run any user scripts.
if [ -f /system/sdcard/config/userscripts/motiondetection/* ]; then
for i in /system/sdcard/config/userscripts/motiondetection/*; do
echo "Running: $i off"
$i off
done
fi

View File

@@ -37,3 +37,11 @@ fi
if [ "$sendemail" = true ] ; then
/system/sdcard/scripts/sendPictureMail.sh&
fi
# Run any user scripts.
if [ -f /system/sdcard/config/userscripts/motiondetection/* ]; then
for i in /system/sdcard/config/userscripts/motiondetection/*; do
echo "Running: $i on"
$i on
done
fi