1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-23 00:43:28 +00:00
freebsd-ports/games/mtaserver/files/mtad.in
Pawel Pekala 45e0b0cea1 - Add staging support
- Simplify file substitutions by using ETCDIR, DATADIR
- Define DOCS option
- Use @sample for config file
2014-04-12 13:47:54 +00:00

42 lines
868 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: mtad
# REQUIRE: NETWORKING
#
# Add the following line to /etc/rc.conf[.local] to enable mtad
#
# mtad_enable (bool): Set to "NO" by default.
# Set it to "YES" to enable mtad.
. /etc/rc.subr
name="mtad"
rcvar=mtad_enable
load_rc_config $name
: ${mtad_enable="NO"}
: ${mtad_chdir="%%DATADIR%%"}
: ${mtad_config="%%ETCDIR%%/mtaserver.conf"}
: ${mtad_logfile="/var/log/mtaserver.log"}
command="%%DATADIR%%/mtaserver"
command_args="-b -c ${mtad_config} -l ${mtad_logfile} 2>&1 > /dev/null &"
required_files=${mtad_config}
start_precmd="mtad_prestart"
stop_precmd="mtad_prestop"
mtad_prestart() {
if ! kldstat -v | grep -E 'linux(aout|elf)' > /dev/null; then
err 1 "Linux support required"
fi
}
mtad_prestop() {
rc_pid=`echo $rc_pid | awk '{print $1}'`
}
run_rc_command "$1"