2014-03-10 05:18:05 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2015-11-19 04:40:31 +00:00
|
|
|
# PROVIDE: sickgear
|
2014-03-10 05:18:05 +00:00
|
|
|
# REQUIRE: LOGIN
|
|
|
|
# KEYWORD: shutdown
|
|
|
|
#
|
|
|
|
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
|
|
|
# to enable this service:
|
|
|
|
#
|
2015-11-19 04:40:31 +00:00
|
|
|
# sickgear_enable (bool): Set to NO by default.
|
2014-03-10 05:18:05 +00:00
|
|
|
# Set it to YES to enable it.
|
2015-11-19 04:40:31 +00:00
|
|
|
# sickgear_user: The user account SickGear daemon runs as what
|
2014-03-10 05:18:05 +00:00
|
|
|
# you want it to be. It uses '_sabnzbd' user by
|
|
|
|
# default. Do not sets it as empty or it will run
|
|
|
|
# as root.
|
2015-11-19 04:40:31 +00:00
|
|
|
# sickgear_dir: Directory where SickGear lives.
|
|
|
|
# Default: /usr/local/sickgear
|
|
|
|
# sickgear_chdir: Change to this directory before running SickGear.
|
|
|
|
# Default is same as sickgear_dir.
|
|
|
|
# sickgear_datadir: Data directory for Sick Beard (DB, Logs, config)
|
|
|
|
# Default is same as sickgear_chdir
|
2017-07-05 01:10:10 +00:00
|
|
|
# sickgear_pidfile: The name of the pidfile to create.
|
2015-11-19 04:40:31 +00:00
|
|
|
# Default is sickgear.pid in sickgear_dir.
|
|
|
|
# sickgear_port: The port SickGear is listening on
|
2014-03-10 05:18:05 +00:00
|
|
|
# Default is 8081
|
|
|
|
PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
2015-11-19 04:40:31 +00:00
|
|
|
name="sickgear"
|
2014-03-10 05:18:05 +00:00
|
|
|
rcvar=${name}_enable
|
|
|
|
|
|
|
|
load_rc_config ${name}
|
|
|
|
|
2015-11-19 04:40:31 +00:00
|
|
|
: ${sickgear_enable:="NO"}
|
|
|
|
: ${sickgear_user:="_sabnzbd"}
|
|
|
|
: ${sickgear_dir:="/usr/local/sickgear"}
|
|
|
|
: ${sickgear_chdir:="${sickgear_dir}"}
|
|
|
|
: ${sickgear_datadir:="${sickgear_chdir}"}
|
2017-07-05 01:10:10 +00:00
|
|
|
: ${sickgear_pidfile:="${sickgear_dir}/sickgear.pid"}
|
2015-11-19 04:40:31 +00:00
|
|
|
: ${sickgear_host:="127.0.0.1"}
|
|
|
|
: ${sickgear_port:="8081"}
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2017-07-05 01:10:10 +00:00
|
|
|
command="/usr/local/bin/python"
|
|
|
|
command_args="${sickgear_dir}/SickBeard.py --daemon --pidfile ${sickgear_pidfile}"
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2014-05-29 01:07:32 +00:00
|
|
|
# Add datadir to the command if set
|
2015-11-19 04:40:31 +00:00
|
|
|
[ ! -z "${sickgear_datadir}" ] && \
|
|
|
|
command_args="${command_args} --datadir ${sickgear_datadir}"
|
2014-03-10 05:18:05 +00:00
|
|
|
|
|
|
|
run_rc_command "$1"
|