ports/90078: addition of a gnump3d.sh rc script
Josh Carroll
josh.carroll at psualum.com
Tue Dec 13 06:47:22 UTC 2005
Hello,
Below is an RCng-style script. Please let me know if there are
any problems with it or if you have any questions.
Regards,
Josh
--- gnump3d.sh begins here ---
#!/bin/sh
#
# PROVIDE: gnump3d
# REQUIRE: DAEMON NETWORKING LOGIN
# KEYWORD: FreeBSD shutdown
. /etc/rc.subr
gnump3d_enable=${gnump3d_enable-"NO"}
gnump3d_program=${gnump3d_program:-/usr/local/bin/gnump3d}
gnump3d_flags=${gnump3d_flags-"--quiet --background"}
gnump3d_pidfile=${gnump3d_pidfile:-/var/run/gnump3d.pid}
name="gnump3d"
rcvar=`set_rcvar`
command="/usr/local/bin/gnump3d"
command_interpreter="/usr/bin/perl"
pidfile="${gnump3d_pidfile}"
load_rc_config $name
start_cmd=gnump3d_start
# hack to capture the PID
gnump3d_start() {
pid=`check_process ${command} ${command_interpreter}`
if [ -z $pid ]; then
echo "Starting ${name}."
${command} ${gnump3d_flags}
pid=`check_process ${command} ${command_interpreter}`
echo $pid > ${gnump3d_pidfile}
else
echo "${name} already running? (pid = $pid)"
fi
}
run_rc_command "$1"
--- gnump3d.sh ends here ---
More information about the freebsd-ports-bugs
mailing list