12,6 → 12,7 |
# - It logs out users whose PCs are quiet (their status tab is closed) |
# - It logs out users whose MAC address is used by other systems (usurped) |
|
export LC_ALL=C.UTF-8 |
CONF_FILE="/usr/local/etc/alcasar.conf" |
EXTIF=`grep ^EXTIF= $CONF_FILE|cut -d"=" -f2` # EXTernal InterFace |
INTIF=`grep ^INTIF= $CONF_FILE|cut -d"=" -f2` # INTernal InterFace |
82,7 → 83,7 |
if [ "$MULTIWAN" == "off" ] || [ "$MULTIWAN" == "Off" ] |
then |
IP_GW=`/sbin/ip route list|grep ^default|cut -d" " -f3` |
arp_reply=`LANG=en_US.UTF-8 /usr/sbin/arping -I$EXTIF -c1 $IP_GW|grep response|cut -d" " -f2` |
arp_reply=`/usr/sbin/arping -I$EXTIF -c1 $IP_GW|grep response|cut -d" " -f2` |
if [ $arp_reply -eq "0" ] |
then |
LAN_DOWN="2" |
164,7 → 165,7 |
# IP usurpation test : process only equipment with an authenticated user |
if [[ $(expr $active_session) -eq 1 ]] |
then |
arp_reply=`LANG=en_US.UTF-8 /usr/sbin/arping -b -I$INTIF -s$PRIVATE_IP -c1 -w4 $active_ip|grep -c "Unicast reply"` |
arp_reply=`/usr/sbin/arping -b -I$INTIF -s$PRIVATE_IP -c1 -w4 $active_ip|grep -c "Unicast reply"` |
# disconnect users whose equipement is usurped. For example, if there are 2 same @MAC it will make 2 lines in output. |
if [[ $(expr $arp_reply) -gt 1 ]] |
then |