You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
800 B
36 lines
800 B
2 years ago
|
#!/bin/bash
|
||
|
|
||
|
#Ausgabe der Prüfroutine checken
|
||
|
LOG=$1
|
||
|
ERRORMAIL=$2
|
||
|
|
||
|
echo "Prüfroutine"
|
||
|
|
||
|
fgrep -s "not found" $LOG
|
||
|
FLAG1=$?
|
||
|
fgrep -i -s "error" $LOG
|
||
|
FLAG2=$?
|
||
|
fgrep -i -s "nicht gefunden" $LOG
|
||
|
FLAG3=$?
|
||
|
fgrep -i -s "Exception" $LOG
|
||
|
FLAG4=$?
|
||
|
fgrep -i -s "Keine Berechtigung" $LOG
|
||
|
FLAG5=$?
|
||
|
fgrep -i -s "Permission denied" $LOG
|
||
|
FLAG6=$?
|
||
|
fgrep -i -s "warning" $LOG
|
||
|
FLAG7=$?
|
||
|
fgrep -i -s "Warnung" $LOG
|
||
|
FLAG8=$?
|
||
|
|
||
|
if [ $FLAG1 -eq 0 -o $FLAG2 -eq 0 -o $FLAG3 -eq 0 -o $FLAG4 -eq 0 -o $FLAG5 -eq 0 -o $FLAG6 -eq 0 -o $FLAG7 -eq 0 -o $FLAG8 -eq 0 ]
|
||
|
then
|
||
|
echo "Die Prüfroutine hat Warnungen ergeben"
|
||
|
echo "sending errormail TO $ERRORMAIL"
|
||
|
$MAILPROG -s "Warnung in Pruefroutine $LOG" $ERRORMAIL <$LOG
|
||
|
else
|
||
|
echo " .. OK"
|
||
|
echo "(Keine Warnungen aufgefallen in $LOG)"
|
||
|
echo
|
||
|
fi
|