Annotation of embedaddon/coova-chilli/debian/coova-chilli.chilli.init, revision 1.1
1.1 ! misho 1: #! /bin/sh
! 2: #
! 3: # skeleton example file to build /etc/init.d/ scripts.
! 4: # This file should be used to construct scripts for /etc/init.d.
! 5: #
! 6: # Written by Miquel van Smoorenburg <miquels@cistron.nl>.
! 7: # Modified for Debian GNU/Linux
! 8: # by Ian Murdock <imurdock@gnu.ai.mit.edu>.
! 9: #
! 10: # Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
! 11: #
! 12: # This file was automatically customized by dh-make on Thu, 1 Apr 2004 20:05:44 +0200
! 13:
! 14: PATH=/sbin:/bin:/usr/sbin:/usr/bin
! 15: DAEMON=/usr/sbin/chilli
! 16: NAME=chilli
! 17: DESC=chilli
! 18: CONFFILE=/etc/chilli.conf
! 19: OPTS="--pidfile /var/run/$NAME.pid"
! 20:
! 21: START_CHILLI=0
! 22:
! 23: if [ -f /etc/default/chilli ] ; then
! 24: . /etc/default/chilli
! 25: fi
! 26:
! 27: if [ "$START_CHILLI" != "1" ] ; then
! 28: echo "Chilli default off. Look at /etc/default/chilli"
! 29: exit 0
! 30: fi
! 31:
! 32: test -f $DAEMON || exit 0
! 33: test -f $CONFFILE || exit 0
! 34:
! 35:
! 36: . /etc/chilli/functions
! 37:
! 38: check_required
! 39:
! 40: RETVAL=0
! 41: prog="chilli"
! 42:
! 43:
! 44: case "$1" in
! 45: start)
! 46: echo -n "Starting $DESC: "
! 47: /sbin/modprobe tun >/dev/null 2>&1
! 48: echo 1 > /proc/sys/net/ipv4/ip_forward
! 49:
! 50: writeconfig
! 51: radiusconfig
! 52:
! 53: (crontab -l 2>&- | grep -v $0
! 54: test ${HS_ADMINTERVAL:-0} -gt 0 && echo "*/$HS_ADMINTERVAL * * * * $0 radconfig"
! 55: echo "*/10 * * * * $0 checkrunning"
! 56: #echo "*/2 * * * * $0 arping"
! 57: ) | crontab - 2>&-
! 58:
! 59: ifconfig $HS_LANIF 0.0.0.0
! 60:
! 61: start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
! 62: --exec $DAEMON -- $OPTS
! 63: RETVAL=$?
! 64: echo "$NAME."
! 65: ;;
! 66:
! 67: checkrunning)
! 68: check=`start-stop-daemon --start --exec $DAEMON --test`
! 69: if [ x"$check" != x"$DAEMON already running." ] ; then
! 70: $0 start
! 71: fi
! 72: ;;
! 73:
! 74: radconfig)
! 75: [ -e $MAIN_CONF ] || writeconfig
! 76: radiusconfig
! 77: ;;
! 78:
! 79: restart)
! 80: $0 stop
! 81: $0 start
! 82: RETVAL=$?
! 83: ;;
! 84:
! 85: stop)
! 86: echo -n "Stopping $DESC: "
! 87:
! 88: crontab -l 2>&- | grep -v $0 | crontab -
! 89:
! 90:
! 91: start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.pid \
! 92: --exec $DAEMON
! 93: echo "$NAME."
! 94: ;;
! 95:
! 96: reload)
! 97: echo "Reloading $DESC."
! 98: start-stop-daemon --stop --signal 1 --quiet --pidfile \
! 99: /var/run/$NAME.pid --exec $DAEMON
! 100: ;;
! 101:
! 102: condrestart)
! 103: check=`start-stop-daemon --start --exec $DAEMON --test`
! 104: if [ x"$check" != x"$DAEMON already running." ] ; then
! 105: $0 restart
! 106: RETVAL=$?
! 107: fi
! 108: ;;
! 109:
! 110: status)
! 111: status chilli
! 112: RETVAL=$?
! 113: ;;
! 114:
! 115: *)
! 116: N=/etc/init.d/$NAME
! 117: echo "Usage: $N {start|stop|restart|condrestart|status|reload|radconfig}" >&2
! 118: exit 1
! 119: ;;
! 120: esac
! 121:
! 122: exit 0
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>