Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 75 lines (68 sloc) 1.523 kb
#!/bin/sh
#
# radiusd Start the radius daemon.
#
prefix=@prefix@
exec_prefix=@exec_prefix@
sbindir=@sbindir@
localstatedir=@localstatedir@
logdir=@logdir@
rundir=${localstatedir}/run
RADIUSD=$sbindir/radiusd
WATCHER=$sbindir/radwatch
DESC="Freeradius server"
NAME1=radiusd
NAME2=radwatch
ARGS="-y"
test -f $RADIUSD || exit 0
case "$1" in
start)
if [ ! -f $logdir/radutmp ]
then
>$logdir/radutmp
fi
echo -n "Starting $DESC:"
if [ -x $WATCHER ]
then
echo -n " radwatch"
start-stop-daemon --start --quiet --startas $WATCHER \
--pidfile $rundir/$NAME2.pid --exec $RADIUSD -- $ARGS
# and the watcher starts radiusd.
echo -n " radiusd"
else
echo -n " radiusd"
start-stop-daemon --start --quiet \
--pidfile $rundir/$NAME1.pid --exec $RADIUSD -- $ARGS
fi
echo "."
;;
stop)
[ -z "$2" ] && echo -n "Stopping $DESC: "
if [ -x $WATCHER ]
then
[ -z "$2" ] && echo -n "radwatch "
start-stop-daemon --stop --quiet \
--pidfile $rundir/$NAME2.pid -- exec $RADWATCH
# but we have to stop radiusd manually.
killall radiusd 2>/dev/null
else
start-stop-daemon --stop --quiet \
--pidfile $rundir/$NAME1.pid --exec $RADIUSD
fi
[ -z "$2" ] && echo "radiusd."
;;
reload|force-reload)
echo "Reloading $DESC configuration files."
start-stop-daemon --stop --signal 1 --quiet --pidfile \
$rundir/$NAME1.pid --exec $RADIUSD
;;
restart)
sh $0 stop quiet
sleep 3
sh $0 start
;;
*)
echo "Usage: /etc/init.d/$NAME1 {start|stop|reload|restart}"
exit 1
esac
exit 0
Jump to Line
Something went wrong with that request. Please try again.