Update version numbers
[freeradius.git] / suse / rcradiusd
1 #! /bin/sh
2 # Copyright (c) 2001       SuSE GmbH Nuernberg, Germany.
3 #               2002, 2003 SuSE Linux AG, Nuernberg, Germany.
4 #
5 # Author: Wolfgang Rosenauer <feedback@suse.de>, 2000-2003
6 #
7 # /etc/init.d/radiusd
8 #
9 #   and symbolic its link
10 #
11 # /usr/bin/rcradiusd
12 #
13 ### BEGIN INIT INFO
14 # Provides:          radiusd
15 # Required-Start:    $network $syslog $remotefs
16 # Required-Stop:
17 # Default-Start:     3 5
18 # Default-Stop:      0 1 2 6
19 # Short-Description: RADIUS-Server
20 # Description:       Remote Authentication Dialin User Server
21 ### END INIT INFO
22
23 RADIUSD_BIN=/usr/sbin/radiusd
24 test -x $RADIUSD_BIN || exit 5
25
26 . /etc/rc.status
27
28 rc_reset
29 case "$1" in
30     start)
31         echo -n "Starting RADIUS daemon "
32         startproc $RADIUSD_BIN >/dev/null
33         rc_status -v    
34         ;;
35     stop)
36         echo -n "Shutting down RADIUS daemon "
37         killproc -TERM $RADIUSD_BIN 
38         rc_status -v    
39         ;;
40     try-restart)
41         ## If first returns OK call the second, if first or
42         ## second command fails, set echo return value.
43         $0 status >/dev/null &&  $0 restart
44         rc_status
45         ;;
46     restart)
47         ## Stop the service and regardless of whether it was
48         ## running or not, start it again.
49         $0 stop
50         $0 start
51         rc_status
52         ;;
53     force-reload)
54         ## Signal the daemon to reload its config. Most daemons
55         ## do this on signal 1 (SIGHUP).
56         ## If it does not support it, restart.
57
58         echo -n "Reload RADIUS daemon "
59         killproc -HUP $RADIUSD_BIN
60         rc_status -v
61         ;;
62     reload)
63         ## Like force-reload, but if daemon does not support
64         ## signalling, do nothing (!)
65
66         echo -n "Reload RADIUS daemon "
67         killproc -HUP $RADIUSD_BIN 
68         rc_status -v
69         ;;
70     status)
71         echo -n "Checking for service radiusd "
72         checkproc $RADIUSD_BIN
73         rc_status -v
74         ;;
75     *)
76         echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
77         exit 1
78         ;;
79 esac
80 rc_exit