summaryrefslogtreecommitdiff
blob: 301a02f89bed24913482c5ad02ed16657b7fcb93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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
}