forked from dl1bff/ircddbd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcentos_etc_initd_ircddbd
executable file
·90 lines (75 loc) · 1.71 KB
/
centos_etc_initd_ircddbd
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh
# chkconfig: 2345 99 01
# description: ircddbd daemon
# processname: ircddbd
### BEGIN INIT INFO
# Provides: ircddbd
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start:
# Short-Description: ircDDB daemon
# Description: ircDDB daemon
### END INIT INFO
#
#
# ircddbd daemon
#
# Copyright (C) 2010 Michael Dirska, DL1BFF ([email protected])
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
PROG=ircddbd
PIDFILE=/var/run/$PROG/$PROG.pid
IRCDDBD_BIN=/usr/sbin/$PROG
# Source function library
. /etc/rc.d/init.d/functions
[ -r /etc/default/$PROG ] && . /etc/default/$PROG
RETVAL=0
start()
{
echo -n $"Starting $PROG: "
daemon --user ircddb --pidfile $PIDFILE $DAEMON_ENV $IRCDDBD_BIN $DAEMON_ARGS
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch $PIDFILE
return $RETVAL
}
stop()
{
echo -n $"Shutting down $PROG: "
killproc -p $PIDFILE $IRCDDBD_BIN
RETVAL=$?
echo
rm -f $PIDFILE
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status -p $PIDFILE $IRCDDBD_BIN
;;
restart)
stop
start
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=3
esac
exit $RETVAL