2020-06-01 11:02:23 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-02-13 11:38:38 -08:00
|
|
|
# Copyright (c) 2018-2021, diyIT.org
|
2020-02-25 11:28:31 -08:00
|
|
|
# All rights reserved.
|
|
|
|
#
|
|
|
|
# BSD 2-Clause License ("Simplified BSD License" or "FreeBSD License")
|
|
|
|
# https://diyit.org/license/
|
|
|
|
#
|
|
|
|
#
|
|
|
|
|
|
|
|
# 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()
|
|
|
|
{
|
2020-06-01 11:02:23 -07:00
|
|
|
$camserver startserver -b -c /mnt/config/secret/motioneye/motioneye.conf
|
2020-02-25 11:28:31 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
camserver_stop()
|
|
|
|
{
|
2020-06-01 11:02:23 -07:00
|
|
|
$camserver stopserver
|
2020-02-25 11:28:31 -08:00
|
|
|
}
|
|
|
|
camserver_restart()
|
|
|
|
{
|
|
|
|
camserver_stop
|
|
|
|
camserver_start
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config ${name}
|
|
|
|
run_rc_command "$1"
|