Subversion Repositories ALCASAR

Compare Revisions

Regard whitespace Rev 2375 → Rev 2376

/scripts/alcasar-watchdog.sh
116,14 → 116,15
if [ "$active_user" != "$active_mac" ] && [ $(expr $active_session) -eq 1 ]; then
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)
cmp_user_ok=$(cat $current_users_file | grep "^$active_ip\$" -c)
# If not we disconnect this user.
if [ $cmp_user_ok -eq 0 ]; then
logger "alcasar-watchdog : $active_ip ($active_mac) can't be contact. We disconnects the user ($active_user)."
/usr/sbin/chilli_query logout $active_mac
else
# 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
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 # "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"
/usr/sbin/chilli_query logout $active_mac