#!/usr/bin/openrc-run

name="motion"
description="Motion daemon"

supervisor=supervise-daemon
command=/usr/bin/motion
command_args="$MOTION_OPT"
command_user="motion:video"
error_log="/var/log/motion.log"
output_log="/var/log/motion.log"

depend() {
	after localmount net
}

start_pre() {
	checkpath -f -m 644 -o "$command_user" "$error_log"
}
