45 lines
800 B
Plaintext
45 lines
800 B
Plaintext
|
# Copyright (c) 2018-2020, diyIT.org
|
||
|
# All rights reserved.
|
||
|
#
|
||
|
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
|
||
|
# https://diyit.org/license/
|
||
|
#
|
||
|
#
|
||
|
|
||
|
#!/bin/sh
|
||
|
|
||
|
# the two lines below are not just comments but required by rcorder; service -e
|
||
|
# PROVIDE: camserver
|
||
|
# REQUIRE: NETWORKING SERVERS DAEMON ldconfig resolv
|
||
|
|
||
|
. /etc/rc.subr
|
||
|
|
||
|
: ${camserver_enable="NO"}
|
||
|
|
||
|
name=camserver
|
||
|
rcvar=camserver_enable
|
||
|
|
||
|
camserver="/usr/local/bin/meyectl"
|
||
|
|
||
|
start_cmd="camserver_start"
|
||
|
stop_cmd="camserver_stop"
|
||
|
restart_cmd="camserver_restart"
|
||
|
|
||
|
camserver_start()
|
||
|
{
|
||
|
$camserver startserver -b -c /mnt/config/secret/motioneye/motioneye.conf
|
||
|
}
|
||
|
|
||
|
camserver_stop()
|
||
|
{
|
||
|
$camserver stopserver
|
||
|
}
|
||
|
camserver_restart()
|
||
|
{
|
||
|
camserver_stop
|
||
|
camserver_start
|
||
|
}
|
||
|
|
||
|
load_rc_config ${name}
|
||
|
run_rc_command "$1"
|