wok diff freeradius/stuff/freeradius @ rev 21367

updated litmus (0.12.1 -> 0.13)
author Hans-G?nter Theisgen
date Sun Apr 21 17:10:28 2019 +0100 (2019-04-21)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/freeradius/stuff/freeradius	Sun Apr 21 17:10:28 2019 +0100
     1.3 @@ -0,0 +1,56 @@
     1.4 +#!/bin/sh
     1.5 +# /etc/init.d/freeradius : Start, stop and restart freeradius server on SliTaz, at 
     1.6 +# boot time or with the command line.
     1.7 +#
     1.8 +# To start freeradius server at boot time, just put freeradius in the $RUN_DAEMONS
     1.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf
    1.10 +#
    1.11 +. /etc/init.d/rc.functions
    1.12 +. /etc/daemons.conf
    1.13 +
    1.14 +NAME=freeradius
    1.15 +DESC="freeradius server"
    1.16 +DAEMON=/usr/sbin/radiusd
    1.17 +OPTIONS=$FREERADIUS_OPTIONS
    1.18 +PIDFILE=/var/run/radiusd/radiusd.pid
    1.19 +[ -n "$OPTIONS" ] || OPTIONS="-d /etc/raddb -i 0.0.0.0 -p 1812"
    1.20 +
    1.21 +case "$1" in
    1.22 +  start)
    1.23 +    if active_pidfile $PIDFILE radiusd ; then
    1.24 +      echo "$NAME already running."
    1.25 +      exit 1
    1.26 +    fi
    1.27 +    echo -n "Starting $DESC: $NAME... "
    1.28 +    $DAEMON $OPTIONS
    1.29 +    status
    1.30 +    ;;
    1.31 +  stop)
    1.32 +    if ! active_pidfile $PIDFILE radiusd ; then
    1.33 +      echo "$NAME is not running."
    1.34 +      exit 1
    1.35 +    fi
    1.36 +    echo -n "Stopping $DESC: $NAME... "
    1.37 +    kill $(cat $PIDFILE)
    1.38 +    status
    1.39 +    ;;
    1.40 +  restart)
    1.41 +    if ! active_pidfile $PIDFILE radiusd ; then
    1.42 +      echo "$NAME is not running."
    1.43 +      exit 1
    1.44 +    fi
    1.45 +    echo -n "Restarting $DESC: $NAME... "
    1.46 +    kill $(cat $PIDFILE)
    1.47 +    sleep 2
    1.48 +    $DAEMON $OPTIONS
    1.49 +    status
    1.50 +    ;;
    1.51 +  *)
    1.52 +    echo ""
    1.53 +    echo -e "\033[1mUsage:\033[0m /etc/init.d/$(basename $0) [start|stop|restart]"
    1.54 +    echo ""
    1.55 +    exit 1
    1.56 +    ;;
    1.57 +esac
    1.58 +
    1.59 +exit 0