Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Timothy Frew
Sympl
Commits
c13625f1
Commit
c13625f1
authored
Mar 26, 2020
by
Paul Cammish
Browse files
Deal with cases where the clamAV definitions cant be downloaded from their mirror(s).
parent
a4cc7574
Changes
1
Hide whitespace changes
Inline
Side-by-side
autotest/test.d/01-setup
View file @
c13625f1
...
...
@@ -14,20 +14,18 @@ fi
if
[
$(
grep
-c
public_ip /etc/hosts
)
==
0
]
;
then
echo
$(
sympl-ip
)
public_ip
>>
/etc/hosts
;
fi
# try a definiton update manually with the service stopped
service clamav-freshclam stop
service clamav-daemon stop
freshclam
# enable antivirus in sympl and start the services
# remove any existing definations
touch
/srv/
$(
hostname
-f
)
/config/antivirus
# Start freshclam to download new definitions, whatever state it's in
systemctl unmask clamav-freshclam
service clamav-freshclam stop
rm
-rf
/run/clamav
service clamav-freshclam start
sleep
3
echo
-n
"I: Waiting for clamav to download
/update
databases."
echo
-n
"I: Waiting for clamav to download databases."
for
i
in
$(
seq
1 100
)
;
do
if
[
-f
"/var/lib/clamav/main.cvd"
-o
-f
"/var/lib/clamav/main.cld"
]
;
then
echo
-n
' 1/3 '
...
...
@@ -54,8 +52,19 @@ for i in $(seq 1 100) ; do
sleep
1
done
# horrible hack
if
[
-f
"/var/lib/clamav/bytecode.cvd"
-o
-f
"/var/lib/clamav/bytecode.cld"
]
&&
[
-f
"/var/lib/clamav/daily.cvd"
-o
-f
"/var/lib/clamav/daily.cld"
]
&&
[
-f
"/var/lib/clamav/main.cvd"
-o
-f
"/var/lib/clamav/main.cld"
]
;
then
echo
"We have what look to be valid definitions..."
else
echo
"Failed to download clamAV definitions, going to fallback."
cd
/var/lib/clamav/
wget
-qO
clamav.tar.gz http://sympl.host/clamav.tar.gz
tar
-xvf
clamav.tar.gz
fi
# Start clamav, whatever state it's currently in
systemctl unmask clamav-daemon
service clamav-daemon stop
service clamav-daemon start
# Enable antispam and antivirus as default, otherwise monit would stop them.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment