ssahani / rpms / freeradius

Forked from rpms/freeradius 5 years ago
Clone
0af6907
#!/bin/sh
0af6907
#
0af6907
# chkconfig: - 88 10
0af6907
# description: Start/Stop the RADIUS server daemon
0af6907
#
0af6907
#    This program is free software; you can redistribute it and/or modify
0af6907
#    it under the terms of the GNU General Public License as published by
0af6907
#    the Free Software Foundation; either version 2 of the License, or
0af6907
#    (at your option) any later version.
0af6907
#
0af6907
#    This program is distributed in the hope that it will be useful,
0af6907
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
0af6907
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0af6907
#    GNU General Public License for more details.
0af6907
#
0af6907
#    You should have received a copy of the GNU General Public License
0af6907
#    along with this program; if not, write to the Free Software
0af6907
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
0af6907
#
0af6907
#    Copyright (C) 2001 The FreeRADIUS Project   http://www.freeradius.org
0af6907
#
0af6907
0af6907
# Source function library.
0af6907
. /etc/rc.d/init.d/functions
0af6907
0af6907
RADIUSD=/usr/sbin/radiusd
0af6907
LOCKF=/var/lock/subsys/radiusd
0af6907
CONFIG=/etc/raddb/radiusd.conf
0af6907
0af6907
[ -f $RADIUSD ] || exit 0
0af6907
[ -f $CONFIG ] || exit 0
0af6907
0af6907
RETVAL=0
0af6907
0af6907
case "$1" in
0af6907
  start)
0af6907
	echo -n $"Starting RADIUS server: "
0af6907
	daemon $RADIUSD
0af6907
	RETVAL=$?
0af6907
	echo
0af6907
	[ $RETVAL -eq 0 ] && touch $LOCKF &&
0af6907
	    ln -s /var/run/radiusd/radiusd.pid /var/run/radiusd.pid 2>/dev/null
0af6907
	;;
0af6907
  stop)
0af6907
	echo -n $"Stopping RADIUS server: "
0af6907
	killproc $RADIUSD
0af6907
	RETVAL=$?
0af6907
	echo
0af6907
	[ $RETVAL -eq 0 ] && rm -f $LOCKF
0af6907
	;;
0af6907
  status)
0af6907
	status radiusd
0af6907
	RETVAL=$?
0af6907
        ;;
0af6907
  reload)
0af6907
	echo -n $"Reloading RADIUS server: "
0af6907
	killproc $RADIUSD -HUP
0af6907
	RETVAL=$?
0af6907
	echo
0af6907
	;;
0af6907
  restart)
0af6907
	$0 stop
0af6907
	sleep 3
0af6907
	$0 start
0af6907
	RETVAL=$?
0af6907
	;;
0af6907
  condrestart)
0af6907
	if [ -f $LOCKF ]; then
0af6907
		$0 stop
0af6907
		sleep 3
0af6907
		$0 start
0af6907
		RETVAL=$?
0af6907
	fi
0af6907
	;;
0af6907
  *)
0af6907
	echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
0af6907
	exit 1
0af6907
esac
0af6907
0af6907
exit $RETVAL