32,12 → 32,12 |
{ |
case $LAN_DOWN in |
"1") |
logger "$EXTIF (WAN card) link down" |
logger -t alcasar-watchdog "$EXTIF (WAN card) link down" |
echo "$EXTIF (WAN card) link down" |
/bin/sed -i "s?diagnostic =.*?diagnostic = \"$EXTIF (WAN card) link down\";?g" $Index_Page |
;; |
"2") |
logger "can't contact the default router" |
logger -t alcasar-watchdog 'can't contact the default router' |
echo "can't contact the default router" |
/bin/sed -i "s?diagnostic =.*?diagnostic = \"can't contact the default router\";?g" $Index_Page |
;; |
119,7 → 119,7 |
cmp_user_ok=$(cat $current_users_file | awk -F':' "\$1 == \"$active_ip\" {print \$2}") |
# If not we disconnect this user. |
if [ -z "$cmp_user_ok" ]; then |
logger "alcasar-watchdog : $active_ip ($active_mac) can't be contact. We disconnects the user ($active_user)." |
logger -t alcasar-watchdog "$active_ip ($active_mac) can't be contact. We disconnects the user ($active_user)." |
/usr/sbin/chilli_query logout $active_mac |
elif [ "$cmp_user_ok" == "TEMP" ]; then |
# Remove the user's IP from 'current_users.txt'. Every user need to insert their @IP everytime to prove their connectivity. |
126,7 → 126,7 |
sed -i "/^$active_ip:$cmp_user_ok\$/d" $current_users_file |
fi |
else # "current_user.txt" does not exists. We disconnect every users. |
logger "alcasar-watchdog : The file /var/tmp/havp/current_users.txt doen't' exist. We disconnects the user $active_user" |
logger -t alcasar-watchdog "The file /var/tmp/havp/current_users.txt doen't' exist. We disconnects the user $active_user" |
/usr/sbin/chilli_query logout $active_mac |
fi |
fi |
138,7 → 138,7 |
if [[ $(expr $arp_reply) -gt 1 ]] |
then |
echo "[$(date +"%Y-%m-%d %H:%M:%S")] : alcasar-watchdog : $active_ip is usurped ($active_mac). Alcasar disconnect the user ($active_user)." >> /var/Save/security/watchdog.log |
logger "alcasar-watchdog : $active_ip is usurped ($active_mac). Alcasar disconnect the user ($active_user)." |
logger -t alcasar-watchdog "$active_ip is usurped ($active_mac). Alcasar disconnect the user ($active_user)." |
/usr/sbin/chilli_query logout $active_mac |
chmod 644 /var/Save/security/watchdog.log |
fi |