|
Line 0
Link Here
|
|
|
1 |
#!/bin/sh |
| 2 |
|
| 3 |
# $FreeBSD: head/multimedia/oscam/files/oscam.in 365334 2014-08-18 17:54:21Z decke $ |
| 4 |
# |
| 5 |
# PROVIDE: oscam |
| 6 |
# REQUIRE: DAEMON |
| 7 |
# KEYWORD: shutdown |
| 8 |
# |
| 9 |
# Add the following line to /etc/rc.conf[.local] to enable oscam |
| 10 |
# |
| 11 |
# oscam_enable (bool): Set to "NO" by default. |
| 12 |
# Set it to "YES" to enable oscam. |
| 13 |
# oscam_flags (str): Custom flags for oscam. |
| 14 |
|
| 15 |
. /etc/rc.subr |
| 16 |
|
| 17 |
name=oscam |
| 18 |
rcvar=oscam_enable |
| 19 |
load_rc_config $name |
| 20 |
|
| 21 |
: ${oscam_enable:=NO} |
| 22 |
|
| 23 |
pidfile="/var/run/${name}.pid" |
| 24 |
confdir="/usr/local/etc/oscam" |
| 25 |
logdir="/var/log/oscam" |
| 26 |
command="/usr/local/bin/oscam" |
| 27 |
|
| 28 |
command_args="-b -B ${pidfile} -c ${confdir}" |
| 29 |
start_precmd="${name}_prestart" |
| 30 |
|
| 31 |
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin |
| 32 |
|
| 33 |
oscam_prestart() |
| 34 |
{ |
| 35 |
if [ ! -f "${pidfile}" ]; then |
| 36 |
/usr/bin/install -m 644 /dev/null ${pidfile} |
| 37 |
fi |
| 38 |
if [ ! -d "${confdir}" ]; then |
| 39 |
/usr/bin/install -m 755 -d ${confdir} |
| 40 |
fi |
| 41 |
if [ ! -d "${logdir}" ]; then |
| 42 |
/usr/bin/install -m 755 -d ${logdir} |
| 43 |
fi |
| 44 |
} |
| 45 |
|
| 46 |
run_rc_command "$1" |