summaryrefslogtreecommitdiff
blob: 248dd8136161dd4fea1ea03ace887a2b5f093669 (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
#!/sbin/runscript
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-irc/iroffer-dinoex/files/iroffer-dinoex.init,v 1.1 2013/02/08 11:44:38 pinkbyte Exp $

depend() {
	need net
}

start_pre() {
	if [ ! -f "${MYBOT}" ]; then
		eerror "${MYBOT} not found"
		return 1
	fi

	checkpath -d -o "${USER}":"${GROUP}" /var/run/iroffer-dinoex
	checkpath -d -o "${USER}":"${GROUP}" /var/log/iroffer-dinoex
	checkpath -d -o "${USER}":"${GROUP}" /var/lib/iroffer-dinoex
}

start() {
	ebegin "Starting iroffer-dinoex"
	start-stop-daemon --start --quiet  --pidfile "${PIDFILE}" --user "${USER}:${GROUP}" --exec "${BIN}" -- -b "${MYBOT}" -w "${STATE}" -s
	eend $?
}

stop() {
	ebegin "Stopping iroffer-dinoex"
	start-stop-daemon --stop --pidfile "${PIDFILE}" --exec "${BIN}"
	eend $?
}