This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux:antivirus [2025/05/16 10:44] manu |
linux:antivirus [2025/05/16 10:55] (current) manu |
||
---|---|---|---|
Line 166: | Line 166: | ||
<code> | <code> | ||
#!/bin/bash | #!/bin/bash | ||
- | clamlog=/var/log/clamav/clamav.log | + | logname=/var/log/clamav/clamav.log |
- | rm -f $clamlog | + | |
+ | CURRTIME=$(date +"%Y-%m-%d_%H_%M") | ||
+ | clamlog=/var/log/clamav/clamav_${CURRTIME}.log | ||
+ | quarantine=/var/clamav/infected | ||
+ | |||
+ | main() | ||
+ | { | ||
touch $clamlog | touch $clamlog | ||
Line 175: | Line 181: | ||
then mail -s "Malware Found $(hostname -i; uname -a)" $(cat ~/.env/EMAIL) <<< | then mail -s "Malware Found $(hostname -i; uname -a)" $(cat ~/.env/EMAIL) <<< | ||
$(cat $clamlog); fi | $(cat $clamlog); fi | ||
+ | } | ||
+ | main > $logname 2>&1 | ||
</code> | </code> | ||