summaryrefslogtreecommitdiffstats
path: root/irc/ircd-hybrid/files/ircd-hybrid.sh.in
blob: 75acabd5fde2edf0bd3d89980f2b5d0c17c186c0 (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
#!/bin/sh

# PROVIDE: ircd-hybrid
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: FreeBSD shutdown

# To get ircd-hybrid enabled at boot, add the following lines to /etc/rc.conf :
# ircd_hybrid_enable (bool):    Set to "NO" by default.
#                               Set it to "YES" to enable ircd-hybrid.

. /etc/rc.subr

name="ircd_hybrid"
rcvar=`set_rcvar`

command=/usr/local/bin/ircd
pidfile=/var/run/ircd/ircd.pid
required_files=/usr/local/etc/ircd-hybrid/ircd.conf

start_precmd=pid_touch
stop_postcmd=pid_rm

[ -z "$ircd_hybrid_enable" ] && ircd_hybrid_enable=NO
[ -z "$ircd_hybrid_user" ] && ircd_hybrid_user=ircd

load_rc_config $name

pid_touch ()
{
    touch $pidfile
    chown $ircd_hybrid_user $pidfile
}

pid_rm ()
{
    rm $pidfile
}

run_rc_command "$1"
OpenPOWER on IntegriCloud