opnsense-ports/multimedia/plexpy/files/plexpy.in
Franco Fichtner a6df244d8d */*: sync with upstream
Taken from: FreeBSD
2016-05-20 08:45:31 +02:00

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"