Subversion Repositories ALCASAR

Rev

Details | Last modification | View Log

Rev Author Line No. Line
1 root 1
#!/bin/sh
2
#
3
# chilli      CoovaChilli init
4
#
5
# chkconfig: 2345 65 35
6
# description: CoovaChilli
7
 
8
# Source function library.
9
. /etc/rc.d/init.d/functions
10
 
11
. /etc/sysconfig/network
12
 
13
[ ${NETWORKING} = "no" ] && exit 0
14
 
15
[ -f /usr/sbin/chilli ] || exit 0
16
[ -f /etc/chilli.conf ] || exit 0
17
 
18
. /etc/chilli/functions
19
 
20
check_required
21
 
22
RETVAL=0
23
prog="chilli"
24
 
25
case $1 in
26
    start)
27
        echo -n $"Starting $prog: "
28
        /sbin/modprobe tun >/dev/null 2>&1
29
        echo 1 > /proc/sys/net/ipv4/ip_forward
30
 
31
	writeconfig
32
        radiusconfig
33
 
34
#       (crontab -l 2>&- | grep -v $0
35
#            test ${HS_ADMINTERVAL:-0} -gt 0 && echo "*/$HS_ADMINTERVAL * * * * $0 radconfig"
36
#            echo "*/10 * * * * $0 checkrunning"
37
#            echo "*/2  * * * * $0 arping"
38
#        ) | crontab - 2>&-
39
 
34 richard 40
#	ifconfig $HS_LANIF 0.0.0.0
1 root 41
        daemon /usr/sbin/chilli
42
        RETVAL=$?
43
 
44
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/chilli
45
        echo
46
	;;
47
 
48
    checkrunning)
49
	[ -e $LKFILE -a ! -e $PIDFILE ] && $0 start
50
	;;
51
 
52
   radconfig)
53
	[ -e $MAIN_CONF ] || writeconfig
54
	radiusconfig
55
	;;
56
 
57
    reload)
58
	killall -HUP chilli
59
	;;
60
 
61
    restart)
62
	$0 stop
63
	$0 start
64
	RETVAL=$?
65
	;;
66
 
67
    stop)
68
        echo -n $"Shutting down $prog: "
69
 
70
	crontab -l 2>&- | grep -v $0 | crontab -
71
	killproc chilli
72
        [ -f /var/run/chilli.pid ] && {
73
	    kill $(cat /var/run/chilli.pid)
74
	    RETVAL=$
75
	    [ $RETVAL = 0 ] && rm -f /var/lock/subsys/chilli /var/run/chilli.pid
76
	}
77
        echo
78
	;;
79
 
80
    condrestart)
81
        if [ -f /var/lock/subsys/chilli ] ; then
82
	    $0 restart
83
            RETVAL=$?
84
        fi
85
        ;;
86
 
87
    status)
88
        status chilli
89
        RETVAL=$?
90
        ;;
91
 
92
    *)
93
        echo $"Usage: $0 {start|stop|restart|condrestart|status|reload|radconfig}"
94
        exit 1
95
esac
96
 
97
exit $?