diff options
Diffstat (limited to 'media-video/motion/files/motion.initd-r4')
-rw-r--r-- | media-video/motion/files/motion.initd-r4 | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/media-video/motion/files/motion.initd-r4 b/media-video/motion/files/motion.initd-r4 new file mode 100644 index 000000000000..30d5e25cb08e --- /dev/null +++ b/media-video/motion/files/motion.initd-r4 @@ -0,0 +1,30 @@ +#!/sbin/openrc-run +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +: ${MOTION_USER:="motion"} +: ${MOTION_GROUP:="motion"} + +[ "${MOTION_UMASK}" ] && umask="${MOTION_UMASK}" +[ "${MOTION_CONFIGFILE}" ] && command_args="-c ${MOTION_CONFIGFILE}" +[ "${MOTION_LOGFILE}" ] && command_args="${command_args} -l ${MOTION_LOGFILE}" +[ "${MOTION_LOGTYPE}" ] && command_args="${command_args} -k ${MOTION_LOGTYPE}" +[ "${MOTION_LOGLEVEL}" ] && command_args="${command_args} -d ${MOTION_LOGLEVEL}" + +command=/usr/bin/motion +command_user="${MOTION_USER}:${MOTION_GROUP}" + +start_pre() { + if [ "${MOTION_DIR}" ] ; then + mkdir -p "${MOTION_DIR}" + checkpath -d -o "${MOTION_USER}" "${MOTION_DIR}" + directory="${MOTION_DIR}" + fi + if [ "${MOTION_LOGFILE}" ] ; then + local LOGFILE=${MOTION_LOGFILE##*/} + local LOGDIR=${MOTION_LOGFILE%$LOGFILE} + mkdir -p "${LOGDIR}" + checkpath -d -o "${MOTION_USER}" "${LOGDIR}" + fi +} + |