pkgsrc-wip/jabberd2/files/router.sh
Eric Schnoebelen 99c946ea48 Resurrect the package for development/maintenance of the
"cutting-edge" version of jabberd2.
2007-12-09 07:25:35 +00:00

42 lines
833 B
Bash
Executable file

#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: router.sh,v 1.5 2007/12/09 07:25:35 schnoebe Exp $
#
# PROVIDE: router
# REQUIRE: DAEMON c2s
if [ -f /etc/rc.subr ]; then
. /etc/rc.subr
fi
name="router"
rcvar=$name
command="@PREFIX@/bin/${name}"
required_files="@PKG_SYSCONFDIR@/${name}.xml"
extra_commands="reload"
command_args="2>&1 > /dev/null &"
router_user="@JABBERD_USER@"
pidfile="@JABBERD_PIDDIR@/${name}.pid"
stop_postcmd="remove_pidfile"
start_precmd="ensure_piddir"
ensure_piddir()
{
mkdir -p @JABBERD_PIDDIR@
chown @JABBERD_USER@ @JABBERD_PIDDIR@
}
remove_pidfile()
{
if [ -f @JABBERD_PIDDIR@/${name}.pid ]; then
rm -f @JABBERD_PIDDIR@/${name}.pid
fi
}
if [ -f /etc/rc.subr ]; then
load_rc_config $name
run_rc_command "$1"
else
@ECHO@ -n " ${name}"
${command} ${router_flags} ${command_args}
fi