diff options
author | Thomas Zander <riggs@FreeBSD.org> | 2016-01-03 15:55:22 +0000 |
---|---|---|
committer | Thomas Zander <riggs@FreeBSD.org> | 2016-01-03 15:55:22 +0000 |
commit | c0b5b2561264dc1687439cf3cc371dada3d588d5 (patch) | |
tree | 41efaaf46f084d0ea0418d08a3823e3de90250d0 /multimedia/oscam/files/oscam.in | |
parent | b0008804b2db624eb8e7d1025c5ca19323c45508 (diff) | |
download | ports-c0b5b2561264dc1687439cf3cc371dada3d588d5.tar.gz ports-c0b5b2561264dc1687439cf3cc371dada3d588d5.zip |
Notes
Diffstat (limited to 'multimedia/oscam/files/oscam.in')
-rw-r--r-- | multimedia/oscam/files/oscam.in | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/multimedia/oscam/files/oscam.in b/multimedia/oscam/files/oscam.in new file mode 100644 index 000000000000..ceb99afc1d7b --- /dev/null +++ b/multimedia/oscam/files/oscam.in @@ -0,0 +1,46 @@ +#!/bin/sh + +# $FreeBSD$ +# +# PROVIDE: oscam +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following line to /etc/rc.conf[.local] to enable oscam +# +# oscam_enable (bool): Set to "NO" by default. +# Set it to "YES" to enable oscam. +# oscam_flags (str): Custom flags for oscam. + +. /etc/rc.subr + +name=oscam +rcvar=oscam_enable +load_rc_config $name + +: ${oscam_enable:=NO} + +pidfile="/var/run/${name}.pid" +confdir="/usr/local/etc/oscam" +logdir="/var/log/oscam" +command="/usr/local/bin/oscam" + +command_args="-b -B ${pidfile} -c ${confdir}" +start_precmd="${name}_prestart" + +PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin + +oscam_prestart() +{ + if [ ! -f "${pidfile}" ]; then + /usr/bin/install -m 644 /dev/null ${pidfile} + fi + if [ ! -d "${confdir}" ]; then + /usr/bin/install -m 755 -d ${confdir} + fi + if [ ! -d "${logdir}" ]; then + /usr/bin/install -m 755 -d ${logdir} + fi +} + +run_rc_command "$1" |