1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
| #!/bin/bash
for line in $(catlistews5000.txt)
do
dossier=/var/log/log_ws5000/$line/listefichierlog.txt
if [ -f $dossier]
then
log=/var/log/log_ws5000/$line/$line.log
ap01=/var/log/log_ws5000/$line/AP01
ap02=/var/log/log_ws5000/$line/AP02
ap03=/var/log/log_ws5000/$line/AP03
ap04=/var/log/log_ws5000/$line/AP04
ap05=/var/log/log_ws5000/$line/AP05
ap06=/var/log/log_ws5000/$line/AP06
ap07=/var/log/log_ws5000/$line/AP07
ap08=/var/log/log_ws5000/$line/AP08
ap09=/var/log/log_ws5000/$line/AP09
ap10=/var/log/log_ws5000/$line/AP10
ap11=/var/log/log_ws5000/$line/AP11
ap12=/var/log/log_ws5000/$line/AP12
ap13=/var/log/log_ws5000/$line/AP13
ap14=/var/log/log_ws5000/$line/AP14
ap15=/var/log/log_ws5000/$line/AP15
ap16=/var/log/log_ws5000/$line/AP16
ap17=/var/log/log_ws5000/$line/AP17
ap18=/var/log/log_ws5000/$line/AP18
ap19=/var/log/log_ws5000/$line/AP19
ap20=/var/log/log_ws5000/$line/AP20
ap21=/var/log/log_ws5000/$line/AP21
ap22=/var/log/log_ws5000/$line/AP22
ap23=/var/log/log_ws5000/$line/AP23
ap24=/var/log/log_ws5000/$line/AP24
ap25=/var/log/log_ws5000/$line/AP25
ap26=/var/log/log_ws5000/$line/AP26
ap27=/var/log/log_ws5000/$line/AP27
ap28=/var/log/log_ws5000/$line/AP28
ap29=/var/log/log_ws5000/$line/AP29
ap30=/var/log/log_ws5000/$line/AP30
for numap in $(seq 1 9 )
do
AP=AP0$numap
ap=ap0$numap
if ! [ -f $ap ]
then
if grep offline $Log
then
grep offline $Log > /etc/syslog-ng/tmp;
if grep $AP /etc/syslog-ng/tmp
then
echo"find"
rm /etc/syslog-ng/tmp
>/var/log/log_ws5000/$line/$AP
else
echo "find offline without"$AP
rm /etc/syslog-ng/tmp
fi
else
echo"not find"
fi
else
echo "find fichier"$AP
fi
done
for numap in$ (seq 10 30 )
do
AP=AP$numap
ap=ap$numap
if ! [ -f $ap ]
then
if grep offline $Log
then
grep offline $Log >/etc/syslog-ng/tmp;
if grep $AP /etc/syslog-ng/tmp
then
echo "find"
rm /etc/syslog-ng/tmp
>/var/log/log_ws5000/$line/$AP
else
echo "find offline without"$AP
rm /etc/syslog-ng/tmp
fi
else
echo "notfind"
fi
else
echo "find fichier"$AP
fi
done
else
echo"fichier de log"$line".log non trouvee"
fi
done |