Created
May 26, 2020 17:12
-
-
Save philipp-r/3df4f45490bd0e8f803abff1aa651e45 to your computer and use it in GitHub Desktop.
ClamAV Scanner Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
clamscan -i -r $1 > clamlog.txt 2>&1 | |
clamstatus=$? | |
clamlog=$(<clamlog.txt) | |
#echo "$clamlog" | |
if [ $clamstatus == 2 ]; then | |
clamstatustext="ERROR" | |
echo "$clamlog scanned $1" | mailx -s "ClamAV $clamstatustext on 123.456.0.0" [email protected] | |
elif [ $clamstatus == 1 ]; then | |
clamstatustext="VIRUS" | |
echo "$clamlog scanned $1" | mailx -s "ClamAV $clamstatustext on 123.456.0.0" [email protected] | |
else | |
clamstatustext="clean" | |
fi | |
rm clamlog.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment