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:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -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/*
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user