diff options
Diffstat (limited to 'net-irc/ircd-hybrid/files/init.d_ircd')
-rw-r--r-- | net-irc/ircd-hybrid/files/init.d_ircd | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/net-irc/ircd-hybrid/files/init.d_ircd b/net-irc/ircd-hybrid/files/init.d_ircd new file mode 100644 index 000000000000..301a02f89bed --- /dev/null +++ b/net-irc/ircd-hybrid/files/init.d_ircd @@ -0,0 +1,49 @@ +#!/sbin/runscript +# 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.1 2003/12/17 02:37:45 zul Exp $ + +depend() +{ + need net +} + +start() +{ + if [ "${IPV4_OPTS}" != "no" ]; then + ebegin "Starting IRCd-Hybrid7 IPv4 daemon" + start-stop-daemon --start --quiet --background --chuid ircd --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 ircd --exec \ +\ + /usr/sbin/ircd-ipv6 -- ${IPV6_OPTS} + + eend $? + fi +} + +stop() +{ + local ipv4pid="/var/run/ircd/ircd-ipv4.pid" + local ipv6pid="/var/run/ircd/ircd-ipv6.pid" + + 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 +} |