forked from Lainports/opnsense-ports
39 lines
699 B
Bash
39 lines
699 B
Bash
#!/bin/sh
|
|
# Created by: Mark Felder <feld@FreeBSD.org>
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: plexpy
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add the following lines to /etc/rc.conf to enable PlexPy:
|
|
#
|
|
# plexpy_enable="YES"
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=plexpy
|
|
rcvar=plexpy_enable
|
|
load_rc_config $name
|
|
|
|
: ${plexpy_enable:=NO}
|
|
: ${plexpy_user=nobody}
|
|
|
|
pidfile=%%PREFIX%%/plexpy/plexpy.pid
|
|
command_interpreter=%%PYTHON_CMD%%
|
|
command=%%PREFIX%%/plexpy/PlexPy.py
|
|
command_args="-d --nolaunch --pid ${pidfile}"
|
|
start_precmd=plexpy_prestart
|
|
|
|
plexpy_prestart()
|
|
{
|
|
if ! [ -e /etc/localtime ] ; then
|
|
echo "Plexpy needs the system timezone to be set."
|
|
echo "Please run /usr/sbin/tzsetup"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
run_rc_command "$1"
|