-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclamav.txt
61 lines (50 loc) · 2.27 KB
/
clamav.txt
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
#! /usr/bin/bash -w
#####clamav ####### -- 2016-02-06 -- moved from README 2019-06-19
## make SURE clamav is installed:
clamscan --version ;
/usr/bin/clamscan --version ;
## dont forget to change 'SERVER-NAME-HERE' ...!
mkdir --verbose /var/log/clamav/ ; ### need this to start the log directory !
#!/bin/bash
# written from ‘initial setup’ 2016-02-19
#
#
# 2021-01-17 - added server name and used gmailSMTP instead
#
#
SCAN_DIR="/home/" ;
LOG_FILE="/var/log/clamav/manual_clamscan.log" ;
LOG_FILE_TMP="/var/log/clamav/manual_clamscan_tmp.log" ;
VERSION=$(/usr/local/bash/getLinuxVersion.bsh) ; ## 2021-01-17
RESULTS=$(grep 'Infected files:' $LOG_FILE_TMP ; ) ;
EMAIL_SUBJECT="${VERSION} ${RESULTS}" ;
echo 'Starting clam scan!' ;
date;
/usr/bin/clamscan --infected --recursive $SCAN_DIR > $LOG_FILE_TMP ;
cat $LOG_FILE_TMP | mailx -v -A gmailSMTP-noreply -r 'noreply@comptonpeslonline.com' -s "${EMAIL_SUBJECT}" mark@edwardsmark.com ;
cat $LOG_FILE_TMP >> $LOG_FILE ;
date;
# written from ‘initial setup’ 2016-02-19
chmod 755 /etc/cron.daily/manual_clamscan ;
cat /etc/cron.daily/manual_clamscan ; # display the results
cat >> /etc/freshclam.conf <<END_OF_FRESHCLAM ; ### 2019-06-19 - add theses:
DatabaseCustomURL http://sigs.interserver.net/interserver256.hdb
DatabaseCustomURL http://sigs.interserver.net/interservertopline.db
DatabaseCustomURL http://sigs.interserver.net/shell.ldb
DatabaseCustomURL http://sigs.interserver.net/whitelist.fp
END_OF_FRESHCLAM
#####end clamav ###############
exit;
cat <<END > /etc/cron.daily/manual_clamscan ;
#!/bin/bash
# written from ‘initial setup’ 2016-02-19
echo 'starting clam scan';
SCAN_DIR="/home"
LOG_FILE="/var/log/clamav/manual_clamscan.log"
LOG_FILE_TMP="/var/log/clamav/manual_clamscan_tmp.log"
/usr/bin/clamscan --infected --recursive \$SCAN_DIR > \$LOG_FILE_TMP ;
cat \$LOG_FILE_TMP | mailx -r 'edwardsmarkf@gmail.com' -s 'SERVER-NAME-HERE clamav results!' \
mark@edwardsmark.com ;
cat \$LOG_FILE_TMP >> \$LOG_FILE ;
# written from ‘initial setup’ 2016-02-19
END