summaryrefslogtreecommitdiff
blob: 4d8dac81936846fbbaedc007077692375ea3db4f (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
#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

: ${INSPIRCD_USER:="inspircd"}
: ${INSPIRCD_GROUP:="inspircd"}
: ${INSPIRCD_CONFIGFILE:="/etc/inspircd/inspircd.conf"}
: ${INSPIRCD_PIDFILE:="/run/inspircd/inspircd.pid"}
: ${INSPIRCD_SSDARGS:="--quiet --wait 1000"}
: ${INSPIRCD_TERMTIMEOUT:="TERM/25/KILL/5"}
: ${INSPIRCD_OPTS:=""}

command="/usr/bin/inspircd"
command_args="${INSPIRCD_OPTS} --config \"${INSPIRCD_CONFIGFILE}\""
command_user="${INSPIRCD_USER}"
start_stop_daemon_args="${INSPIRCD_SSDARGS}"
pidfile="${INSPIRCD_PIDFILE}"
retry="${INSPIRCD_TERMTIMEOUT}"

required_files="${INSPIRCD_CONFIGFILE}"

name="InspIRCd"

description="InspIRCd is a modular Internet Relay Chat (IRC) server."

extra_commands="version"
extra_started_commands="rehash"

depend() {
	use dns
	provide ircd
}

start_pre() {
	checkpath --directory --mode 0750 --owner ${INSPIRCD_USER}:${INSPIRCD_GROUP} "$(dirname "${INSPIRCD_PIDFILE}")"
}

rehash() {
	ebegin "Rehashing InspIRCd"
	start-stop-daemon --signal HUP --pidfile "${pidfile}"
	eend $?
}

version() {
	ebegin "Retrieve InspIRCd version"
	${command} --version
	eend $?
}