16,11 → 16,7 |
|
EXTIF="eth0" |
INTIF="eth1" |
macallowed_file="/usr/local/etc/alcasar-macallowed" |
conf_file="/usr/local/etc/alcasar.conf" |
private_ip_mask=`grep PRIVATE_IP= $conf_file|cut -d"=" -f2` |
private_ip_mask=${private_ip_mask:=192.168.182.1/24} |
PRIVATE_IP=`echo $private_ip_mask | cut -d"/" -f1` # ALCASAR LAN IP address |
PRIVATE_IP="192.168.182.1" |
tmp_file="/tmp/watchdog.txt" |
DIR_WEB="/var/www/html" |
Index_Page="$DIR_WEB/index.php" |
113,15 → 109,8 |
arp_reply=`/usr/sbin/arping -b -I$INTIF -s$PRIVATE_IP -c1 -w4 $noresponse_ip|grep response|cut -d" " -f2` |
if [[ $(expr $arp_reply) -eq 0 ]] |
then |
mac_allowed=`cat $macallowed_file |grep $noresponse_mac | wc -l` |
if [ $mac_allowed -eq 0 ] |
then |
logger "alcasar-watchdog $noresponse_ip ($noresponse_mac) can't be contact. Alcasar disconnects the user." |
/usr/sbin/chilli_query logout $noresponse_mac |
else |
logger "alcasar-watchdog $noresponse_ip ($noresponse_mac - macallowed) can't be contact. Alcasar release the IP address" |
/usr/sbin/chilli_query dhcp-release $noresponse_mac |
fi |
logger "alcasar-watchdog $noresponse_ip ($noresponse_mac) can't be contact. Alcasar disconnects the user." |
/usr/sbin/chilli_query logout $noresponse_mac |
fi |
done |
rm $tmp_file |