#!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-irc/ircd-hybrid/files/init.d_ircd,v 1.4 2005/07/20 19:11:02 swegener Exp $ opts="${opts} rehash" ipv4pid="/var/run/ircd/ircd-ipv4.pid" ipv6pid="/var/run/ircd/ircd-ipv6.pid" depend() { need net } start() { if [ "${IPV4_OPTS}" != "no" ] then ebegin "Starting IRCd-Hybrid7 IPv4 daemon" start-stop-daemon --start --quiet --background --chuid hybrid --exec \ /usr/sbin/ircd-ipv4 -- ${IPV4_OPTS} eend $? fi if [ -x "/usr/sbin/ircd-ipv6" -a "${IPV6_OPTS}" != "no" ] then ebegin "Starting IRCd-Hybrid7 IPv6 daemon" start-stop-daemon --start --quiet --background --chuid hybrid --exec \ /usr/sbin/ircd-ipv6 -- ${IPV6_OPTS} eend $? fi } stop() { if [ -r "${ipv4pid}" ] then ebegin "Stopping IRCd-Hybrid7 IPv4 daemon" start-stop-daemon --stop --quiet --pidfile="${ipv4pid}" eend $? rm -f "${ipv4pid}" fi if [ -r "${ipv6pid}" ] then ebegin "Stopping IRCd-Hybrid7 IPv6 daemon" start-stop-daemon --stop --quiet --pidfile="${ipv6pid}" eend $? rm -f "${ipv6pid}" fi } rehash() { if [ -r "${ipv4pid}" ] then ebegin "Rehashing IRCd-Hybrid7 IPv4 daemon" kill -s SIGHUP $(cat "${ipv4pid}") eend $? fi if [ -r "${ipv6pid}" ] then ebegin "Rehashing IRCd-Hybrid7 IPv6 daemon" kill -s SIGHUP $(cat "${ipv6pid}") eend $? fi }