Subversion Repositories ALCASAR

Rev

Rev 1165 | Rev 1377 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1165 Rev 1202
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-watchdog.sh 1165 2013-08-16 13:19:54Z crox53 $
2
# $Id: alcasar-watchdog.sh 1202 2013-09-02 16:05:07Z crox53 $
3
 
3
 
4
# alcasar-watchdog.sh
4
# alcasar-watchdog.sh
5
# by Rexy
5
# by Rexy
6
# This script is distributed under the Gnu General Public License (GPL)
6
# This script is distributed under the Gnu General Public License (GPL)
7
# Ce script prévient les usagers de l'indisponibilité de l'accès Internet
7
# Ce script prévient les usagers de l'indisponibilité de l'accès Internet
Line 143... Line 143...
143
						echo "$active_ip $active_mac $active_user" >> $tmp_file
143
						echo "$active_ip $active_mac $active_user" >> $tmp_file
144
					fi
144
					fi
145
				fi
145
				fi
146
# disconnect users whose equipement is usurped (@MAC)
146
# disconnect users whose equipement is usurped (@MAC)
147
				if [[ $(expr $arp_reply) -gt 2 ]]
147
				if [[ $(expr $arp_reply) -gt 2 ]]
148
	       				then
148
	       				then 
149
					echo "alcasar-watchdog : $active_ip is usurped ($active_mac). Alcasar disconnect the user ($active_user)." >> /var/Save/logs/security/watchdog.log
149
					echo "$(date "+[%x-%X] : ")alcasar-watchdog : $active_ip is usurped ($active_mac). Alcasar disconnect the user ($active_user)." >> /var/Save/logs/security/watchdog.log
150
					logger "alcasar-watchdog : $active_ip is usurped ($active_mac). Alcasar disconnect the user ($active_user)."
150
					logger "alcasar-watchdog : $active_ip is usurped ($active_mac). Alcasar disconnect the user ($active_user)."
151
					/usr/sbin/chilli_query logout $active_mac
151
					/usr/sbin/chilli_query logout $active_mac
152
					chmod 644 /var/Save/logs/security/watchdog.log
152
					chmod 644 /var/Save/logs/security/watchdog.log
153
				fi
153
				fi
154
			fi
154
			fi