Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NoCloud-Auto-Installer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NoCloud
NoCloud-Auto-Installer
Commits
00546edb
Unverified
Commit
00546edb
authored
Jan 23, 2017
by
David Beniamine
Browse files
Options
Downloads
Patches
Plain Diff
Fix clamav-weekly file
parent
73472332
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
clamav-weekly.sh
+16
-13
16 additions, 13 deletions
clamav-weekly.sh
initInstall.sh
+2
-0
2 additions, 0 deletions
initInstall.sh
with
18 additions
and
13 deletions
clamav-weekly.sh
+
16
−
13
View file @
00546edb
#!/bin/bash
LOGFILE
=
"/
var/log/clamav
/clamav-
$(
date
+
'%Y-%m-%d'
)
.log"
;
LOGFILE
=
"/
tmp
/clamav-
$(
date
+
'%Y-%m-%d'
)
.log"
;
EMAIL_FROM
=
"clamav-daily@tetras-libre.fr"
;
EMAIL_TO
=
"root"
;
DIRTOSCAN
=
"/var/www /home"
;
...
...
@@ -13,7 +13,7 @@ do_sendmail(){
(
echo
"Subject: [NoCloud ClamAv]
$subject
"
;
echo
"To:
$EMAIL_TO
"
;
echo
"From:
$EMAIL_FROM
"
echo
"Content-Type: text/plain"
;
echo
"Content-Type: text/plain
; charset=UTF-8
"
;
echo
""
;
echo
-e
"
${
message
}
"
)
| sendmail
-t
}
...
...
@@ -23,12 +23,15 @@ for S in ${DIRTOSCAN}; do
echo
"Demarrage du scan hebdomadaire pour le repertoire: '
$S
'. Quantité de données à analyser : '
$DIRSIZE
'"
;
clam
d
scan
-i
"
$S
"
>>
"
$LOGFILE
"
;
clamscan
-
r
i
"
$S
"
>>
$LOGFILE
# get the value of "Infected lines"
MALWARE
=
$(
tail
"
$LOGFILE
"
|grep Infected|cut
-d
" "
-f3
)
;
if
[
"
$MALWARE
"
-ne
"0"
]
;
then
done
if
[
$MALWARE
-ne
0
]
then
subject
=
"Menace detectée"
message
=
"Une menace a été detecté sur votre serveur.
\n
Merci de vous
référer au log ci dessous et si besoin de contacter vos
...
...
@@ -37,6 +40,6 @@ for S in ${DIRTOSCAN}; do
subject
=
"Aucune menace detectée"
message
=
"Aucune menace detectée durant l'analyse hebdomadaire de votre serveur."
fi
done
exit
0
do_sendmail
rm
$LOGFILE
This diff is collapsed.
Click to expand it.
initInstall.sh
+
2
−
0
View file @
00546edb
...
...
@@ -76,6 +76,8 @@ ufw allow https
ufw
enable
# Clamav entry for weekly analysis
systemctl
enable
clamav-daemon
systemctl start clamav-daemon
line
=
"0 1 * * 1
$PWD
/clamav-weekly.sh"
(
crontab
-l
;
echo
$line
)
| crontab -
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment