27 lines
678 B
Bash
Executable file
27 lines
678 B
Bash
Executable file
#!/bin/sh
|
|
|
|
SCRIPT=/usr/scripts/surveillance/mac_prises/mac_prise_holder.py
|
|
ANALYZER=/usr/scripts/surveillance/mac_prises/mac_prise_analyzer.py
|
|
|
|
# Récupération de la liste des switchs
|
|
SWITCHS=$(/usr/bin/host -l adm.crans.org sable.adm.crans.org | /usr/bin/awk '/^bat[abcghijpm]-/{print $1}')
|
|
|
|
# Lancement du listage des macs en parallèle
|
|
python $SCRIPT $SWITCHS
|
|
|
|
CORPS=$(python $ANALYZER)
|
|
LENGTH=$(echo $CORPS | wc -l)
|
|
if [ $LENGTH -ge 2 ]; then
|
|
(
|
|
cat <<EOF
|
|
To: test@lists.crans.org
|
|
From: Spoofing watcher <spoof-watcher@crans.org>
|
|
Subject: Analyse du spoofing
|
|
Content-Type: text/plain; charset="UTF-8"
|
|
|
|
${CORPS}
|
|
--
|
|
Script d'analyse en test
|
|
EOF
|
|
) | /usr/sbin/sendmail -t
|
|
fi;
|