diff --git a/board/raspberrypi/overlay/etc/init.d/S09cpufreq b/board/raspberrypi/overlay/etc/init.d/S05cpufreq similarity index 100% rename from board/raspberrypi/overlay/etc/init.d/S09cpufreq rename to board/raspberrypi/overlay/etc/init.d/S05cpufreq diff --git a/board/raspberrypi2/overlay/etc/init.d/S09cpufreq b/board/raspberrypi2/overlay/etc/init.d/S05cpufreq similarity index 100% rename from board/raspberrypi2/overlay/etc/init.d/S09cpufreq rename to board/raspberrypi2/overlay/etc/init.d/S05cpufreq diff --git a/board/raspberrypi3/overlay/etc/init.d/S09cpufreq b/board/raspberrypi3/overlay/etc/init.d/S05cpufreq similarity index 100% rename from board/raspberrypi3/overlay/etc/init.d/S09cpufreq rename to board/raspberrypi3/overlay/etc/init.d/S05cpufreq diff --git a/board/raspberrypi4/overlay/etc/init.d/S84streameye b/board/raspberrypi4/overlay/etc/init.d/S84streameye new file mode 100755 index 0000000000..624bf3ece1 --- /dev/null +++ b/board/raspberrypi4/overlay/etc/init.d/S84streameye @@ -0,0 +1,52 @@ +#!/bin/sh + +MOTIONEYE_CONF_DIR="/data/etc/" + + +test -n "${OS_VERSION}" || source /etc/init.d/base + +enabled() { + test $(ls -1 ${MOTIONEYE_CONF_DIR}/camera-*.conf 2>/dev/null| wc -l) == 1 || return 1 + + grep '# @proto mjpeg' ${MOTIONEYE_CONF_DIR}/camera-1.conf &>/dev/null || return 1 + + grep -E '# @url http://(.*)127.0.0.1:' ${MOTIONEYE_CONF_DIR}/camera-1.conf &>/dev/null || return 1 + + return 0 +} + +enabled || exit 0 + +start() { + msg_begin "Starting streameye" + streameye.sh start + test $? == 0 && msg_done || msg_fail +} + +stop() { + msg_begin "Stopping streameye" + streameye.sh stop + test $? == 0 && msg_done || msg_fail +} + +case "$1" in + start) + start + ;; + + stop) + stop + ;; + + restart) + stop + start + ;; + + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + +exit $? +