Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > media > main-testing > by-pkgid > 0edb8c0504b7af87a2cfa355e18a2cb0 > files > 34

freeradius-2.0.0-8mdv2008.1.x86_64.rpm

#!/bin/sh

# chkconfig: 345 88 10
# description: Start/Stop the Free RADIUS server daemon

### BEGIN INIT INFO
# Provides: freeradius
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 345
# Short-Description: Starts the Free RADIUS server daemon
# Description: This startup script launches the Free RADIUS server daemon
### END INIT INFO

# Local variables
NAME=freeradius
BINARY=radiusd
PROCESS=radiusd
RADIUSD_OPTIONS=""
LOCKFILE=/var/lock/subsys/radius

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# load service configuration
[ -f /etc/sysconfig/radiusd ] && . /etc/sysconfig/radiusd

start() {
    rc=0
    if [ ! -f $LOCKFILE ]; then
	gprintf "Starting %s" "$NAME"
	daemon "$BINARY $RADIUSD_OPTIONS >/dev/null 2>&1"
	rc=$?
	[ $rc -eq 0 ] && touch $LOCKFILE
	echo
    fi
    return $rc
}

stop() {
    gprintf "Stopping %s" "$NAME"
    killproc $PROCESS
    rc=$?
    [ $rc -eq 0 ] && rm -f $LOCKFILE
    echo
    return $rc
}

restart() {
    stop
    start
}

# See how we were called.
case "$1" in
    start)
	start
	;;
    stop)
	stop
	;;
    status)
	status $PROCESS
	;;
    restart|reload)
	restart
	;;
    *)
	gprintf "Usage: %s {start|stop|status|restart|reload}\n" "$0"
	exit 1
	;;
esac

exit $?