3 daemon_name
=coova-chilli
7 .
/etc
/chilli
/functions
9 DAEMON
=/usr
/sbin
/chilli
14 if [ "$START_CHILLI" != "1" ] ; then
15 echo "Chilli default off. Look at /etc/default/chilli"
19 test -f $DAEMON ||
exit 0
21 MULTI
=$
(ls /etc
/chilli
/*/chilli.conf
2>/dev
/null
)
22 [ -z "$DHCPIF" ] && [ -n "$MULTI" ] && {
25 echo "Found configuration $c"
26 DHCPIF
=$
(basename $
(echo $c|
sed 's#/chilli.conf##'))
28 echo "Running DHCPIF=$DHCPIF $0 $*"
34 if [ -n "$DHCPIF" ]; then
35 CONFIG
=/etc
/chilli
/$DHCPIF/chilli.conf
37 CONFIG
=/etc
/chilli.conf
41 echo "$CONFIG Not found"
48 stat_busy
"Starting Coovachilli"
49 /sbin
/modprobe tun
>/dev
/null
2>&1
50 echo 1 > /proc
/sys
/net
/ipv
4/ip_forward
55 test ${HS_ADMINTERVAL:-0} -gt 0 && {
56 (crontab
-l 2>&- |
grep -v $0
57 echo "*/$HS_ADMINTERVAL * * * * $0 radconfig"
61 ifconfig
$HS_LANIF 0.0.0.0
63 [ ! -d /var
/run
/coovachilli
] && install -d /var
/run
/coovachilli
64 if $DAEMON start
>/dev
/null
; then
65 add_daemon
$daemon_name
74 stat_busy
"Stopping Coovachilli"
75 crontab
-l 2>&- |
grep -v $0 | crontab
-
76 if $DAEMON stop
>/dev
/null
; then
77 rm_daemon
$daemon_name
88 stat_busy
"Restarting Coovachilli"
89 if $DAEMON restart
>/dev
/null
; then
90 add_daemon
$daemon_name
99 stat_busy
"Restarting Coovachilli"
100 if DAEMON restart
>/dev
/null
; then
101 add_daemon
$daemon_name
110 stat_busy
"Checking Coovachilli status";
111 ck_status
$daemon_name
115 stat_busy
"Reloading Coovachilli"
116 if $DAEMON graceful
>/dev
/null
; then
117 add_daemon
$daemon_name
126 [ -e $MAIN_CONF ] || writeconfig
133 echo "usage: $0 {start|stop|restart|condrestart|status|reload|radconfig}"