mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 14:16:31 +00:00
motioneye watcher can now be disabled via watch.conf
This commit is contained in:
parent
9ecea7be88
commit
322642cfa4
@ -3,7 +3,10 @@
|
|||||||
sys_conf="/etc/motioneye.conf"
|
sys_conf="/etc/motioneye.conf"
|
||||||
conf="/data/etc/motioneye.conf"
|
conf="/data/etc/motioneye.conf"
|
||||||
motion_conf="/data/etc/motion.conf"
|
motion_conf="/data/etc/motion.conf"
|
||||||
watch_timeout=120
|
watch_conf="/data/etc/watch.conf"
|
||||||
|
|
||||||
|
meyewatch_timeout=120
|
||||||
|
meyewatch_disable=""
|
||||||
dev_v4l_by_id="/dev/v4l/by-id/"
|
dev_v4l_by_id="/dev/v4l/by-id/"
|
||||||
media_dir="/data/output"
|
media_dir="/data/output"
|
||||||
|
|
||||||
@ -13,6 +16,8 @@ fi
|
|||||||
|
|
||||||
test -f "$conf" || exit 0
|
test -f "$conf" || exit 0
|
||||||
|
|
||||||
|
test -r $watch_conf && source $watch_conf
|
||||||
|
|
||||||
test -n "$os_version" || source /etc/init.d/base
|
test -n "$os_version" || source /etc/init.d/base
|
||||||
|
|
||||||
opts=$(cat "$conf" | while read line; do echo "--$line"; done)
|
opts=$(cat "$conf" | while read line; do echo "--$line"; done)
|
||||||
@ -29,10 +34,10 @@ watch() {
|
|||||||
if responsive; then
|
if responsive; then
|
||||||
count=0
|
count=0
|
||||||
else
|
else
|
||||||
if [ $count -lt $watch_timeout ]; then
|
if [ $count -lt $meyewatch_timeout ]; then
|
||||||
count=$(($count + 5))
|
count=$(($count + 5))
|
||||||
else
|
else
|
||||||
logger -t motioneye -s "not responding for $watch_timeout seconds, rebooting"
|
logger -t motioneye -s "not responding for $meyewatch_timeout seconds, rebooting"
|
||||||
reboot
|
reboot
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -71,9 +76,9 @@ start() {
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $count -gt $watch_timeout ]; then
|
if [ $count -gt $meyewatch_timeout ]; then
|
||||||
msg_fail
|
msg_fail
|
||||||
reboot
|
test -z "$meyewatch_disable" && reboot
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -100,7 +105,9 @@ start() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
watch &
|
if [ -z "$meyewatch_disable" ]; then
|
||||||
|
watch &
|
||||||
|
fi
|
||||||
|
|
||||||
msg_done
|
msg_done
|
||||||
}
|
}
|
||||||
|
@ -10,3 +10,6 @@ netwatch_retries=3
|
|||||||
netwatch_timeout=5
|
netwatch_timeout=5
|
||||||
netwatch_interval=20
|
netwatch_interval=20
|
||||||
|
|
||||||
|
#meyewatch_disable=yes
|
||||||
|
meyewatch_timeout=120
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user