Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2112 → Rev 2113

/scripts/alcasar-watchdog.sh
114,20 → 114,18
#We disconnect inactive user here :
#We check if this is not an auth @MAC and if he is still connected
if [ "$active_user" != "$active_mac" ] && [ $(expr $active_session) -eq 1 ]; then
# If /tmp/current_user.txt exists ...
if [ -e $current_users_file ]; then
# We check if user @IP is in 'current_users.txt'
cmp_user_ok=$(cat $current_users_file | grep $active_ip | wc -w)
# If not we disconnect this user.
if [ $cmp_user_ok -eq 0 ]; then
logger "alcasar-watchdog $active_ip ($active_mac) can't be contact. Alcasar disconnects the user ($active_user)."
logger "alcasar-watchdog : $active_ip ($active_mac) can't be contact. We disconnects the user ($active_user)."
/usr/sbin/chilli_query logout $active_mac
fi
# Remove the user's IP from 'current_users.txt'. Every user need to insert their @IP everytime to prove their connectivity.
sed -i "/^$active_ip/d" $current_users_file
else # "/tmp/current_user.txt" does not exists. We disconnect every users.
logger "Le fichier /tmp/current_users.txt n'existe pas."
logger "alcasar-watchdog $active_ip ($active_mac) can't be contact. Alcasar disconnects the user ($active_user)."
logger "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