pkgsrc/chat/inspircd/files/inspircd.sh
adrianp 9a07bde08b InspIRCd is a modular C++ IRC Daemon for Linux, BSD and Windows systems
created to provide a stable, modern, lightweight ircd (irc server) from
scratch and provide a vast number of features in a modularised form using
an advanced module API. By keeping the functionality of the main core to a
minimum we hope to increase the stability and speed of our project and make
it customisable to the needs of many users.
2007-07-24 20:13:19 +00:00

48 lines
1 KiB
Bash

#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: inspircd.sh,v 1.1.1.1 2007/07/24 20:13:20 adrianp Exp $
#
# PROVIDE: inspircd
# REQUIRE: DAEMON
# KEYWORD: shutdown
#
if [ -f /etc/rc.subr ]
then
. /etc/rc.subr
fi
name="inspircd"
rcvar=${name}
command="@PREFIX@/bin/inspircd"
required_files="@PKG_SYSCONFDIR@/inspircd.conf"
pidfile="@VARBASE@/run/inspircd/inspircd.pid"
inspircd_user="@INSPIRCD_USER@"
inspircd_group="@INSPIRCD_GROUP@"
command_args="--logfile @VARBASE@/log/inspircd.log"
extra_commands="rehash"
rehash_cmd="inspircd_rehash"
start_precmd="inspircd_precmd"
inspircd_precmd()
{
if [ ! -d @VARBASE@/run/inspircd ]; then
@MKDIR@ @VARBASE@/run/inspircd
@CHMOD@ 0750 @VARBASE@/run/inspircd
@CHOWN@ @INSPIRCD_USER@:@INSPIRCD_GROUP@ @VARBASE@/run/inspircd
fi
if [ ! -f @VARBASE@/log/inspircd.log ]; then
@TOUCH@ @VARBASE@/log/inspircd.log
@CHMOD@ 0640 @VARBASE@/log/inspircd.log
@CHOWN@ @INSPIRCD_USER@:@INSPIRCD_GROUP@ @VARBASE@/log/inspircd.log
fi
}
inspircd_rehash()
{
kill -HUP `@CAT@ $pidfile`
}
load_rc_config $name
run_rc_command "$1"