packages/multimedia/motion/files/motion.init
Stijn Tintel eaa1d5aa18 motion: add basic procd init script
Disable the init script by default to avoid log pollution; motion is
very verbose when it cannot open the configured camera.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2019-12-02 00:10:04 +02:00

22 lines
353 B
Bash

#!/bin/sh /etc/rc.common
START=94
USE_PROCD=1
PROG="/usr/bin/motion"
CONF="/etc/motion.conf"
start_service() {
local enabled
config_load "motion"
config_get_bool enabled "general" "enabled" 0
[ "$enabled" -gt 0 ] || return 1
procd_open_instance
procd_set_param command "$PROG"
procd_append_param command -c "$CONF"
procd_close_instance
}