| Line 1... |
Line 1... |
| 1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
| 2 |
# $Id: alcasar-watchdog.sh 840 2012-03-16 14:15:41Z richard $
|
2 |
# $Id: alcasar-watchdog.sh 845 2012-03-29 21:17:03Z richard $
|
| 3 |
|
3 |
|
| 4 |
# alcasar-watchdog.sh
|
4 |
# alcasar-watchdog.sh
|
| 5 |
# by Rexy
|
5 |
# by Rexy
|
| 6 |
# This script is distributed under the Gnu General Public License (GPL)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
| 7 |
|
7 |
|
| Line 111... |
Line 111... |
| 111 |
noresponse_mac=`echo $noresponse | cut -d" " -f2`
|
111 |
noresponse_mac=`echo $noresponse | cut -d" " -f2`
|
| 112 |
noresponse_user=`echo $noresponse | cut -d" " -f3`
|
112 |
noresponse_user=`echo $noresponse | cut -d" " -f3`
|
| 113 |
arp_reply=`/usr/sbin/arping -b -I$INTIF -s$PRIVATE_IP -c1 -w4 $noresponse_ip|grep "Unicast reply"|wc -l`
|
113 |
arp_reply=`/usr/sbin/arping -b -I$INTIF -s$PRIVATE_IP -c1 -w4 $noresponse_ip|grep "Unicast reply"|wc -l`
|
| 114 |
if [[ $(expr $arp_reply) -eq 0 ]]
|
114 |
if [[ $(expr $arp_reply) -eq 0 ]]
|
| 115 |
then
|
115 |
then
|
| 116 |
logger "alcasar-watchdog $noresponse_ip ($noresponse_mac) can't be contact. Alcasar disconnects the user ($noresponce_user)."
|
116 |
logger "alcasar-watchdog $noresponse_ip ($noresponse_mac) can't be contact. Alcasar disconnects the user ($noresponse_user)."
|
| 117 |
/usr/sbin/chilli_query logout $noresponse_mac
|
117 |
/usr/sbin/chilli_query logout $noresponse_mac
|
| 118 |
/usr/sbin/chilli_query dhcp-release $noresponse_mac # release dhcp for mac_auth equipment
|
118 |
/usr/sbin/chilli_query dhcp-release $noresponse_mac # release dhcp for mac_auth equipment
|
| 119 |
fi
|
119 |
fi
|
| 120 |
done
|
120 |
done
|
| 121 |
rm $tmp_file
|
121 |
rm $tmp_file
|