]> git.pld-linux.org Git - packages/freeradius.git/blob - freeradius.init
560056fc57690cb4250282943c9bca5fbc2ff591
[packages/freeradius.git] / freeradius.init
1 #!/bin/sh
2 #
3 # chkconfig: - 88 10
4 # description: Start/Stop the RADIUS server daemon
5 #
6 #    This program is free software; you can redistribute it and/or modify
7 #    it under the terms of the GNU General Public License as published by
8 #    the Free Software Foundation; either version 2 of the License, or
9 #    (at your option) any later version.
10 #
11 #    This program is distributed in the hope that it will be useful,
12 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #    GNU General Public License for more details.
15 #
16 #    You should have received a copy of the GNU General Public License
17 #    along with this program; if not, write to the Free Software
18 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 #
20 #    Copyright (C) 2001 The FreeRADIUS Project   http://www.freeradius.org
21 #
22
23 # Source function library.
24 . /etc/rc.d/init.d/functions
25
26 RADIUSD=/usr/sbin/radiusd
27 LOCKF=/var/lock/subsys/radiusd
28 CONFIG=/etc/raddb/radiusd.conf
29
30 [ -f "$RADIUSD" ] || exit 0
31 [ -f "$CONFIG" ] || exit 0
32
33 RETVAL=0
34
35 case "$1" in
36   start)
37         # Check if the service is already running?
38         if [ ! -f "$LOCKF" ]; then
39                 msg_starting RADIUS
40                 daemon "$RADIUSD" -y
41                 RETVAL=$?
42                 [ $RETVAL -eq 0 ] && touch "$LOCKF"
43         else
44                 msg_already_running RADIUS
45                 exit 1
46         fi
47         ;;
48   stop)
49         # Stop daemons.
50         if [ -f "$LOCKF" ]; then
51                 msg_stopping RADIUS
52                 killproc "$RADIUSD"
53                 rm -f "$LOCKF" > /dev/null 2>&1
54         else
55                 msg_not_running RADIUS
56                 exit 1
57         fi
58         ;;
59   status)
60         status radiusd
61         RETVAL=$?
62         ;;
63   reload)
64         msg_reloading RADIUS
65         busy
66         killproc "$RADIUSD" -HUP
67         RETVAL=$?
68         [ $RETVAL -eq 0 ] && ok || died
69         ;;
70   restart)
71         $0 stop
72         sleep 3
73         $0 start
74         RETVAL=$?
75         ;;
76   condrestart)
77         if [ -f $LOCKF ]; then
78                 $0 stop
79                 sleep 3
80                 $0 start
81                 RETVAL=$?
82         fi
83         ;;
84   *)
85         msg_usage "$0 {start|stop|restart|reload|condrestart|status}"
86         exit 1
87 esac
88
89 exit $RETVAL
This page took 0.074657 seconds and 2 git commands to generate.