Skip to content

Commit

Permalink
Update detect-os-and-install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Aureliolo committed May 22, 2020
1 parent fa977ce commit b37b7bd
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions scripts/detect-os-and-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@

detect=$(cat /etc/*-release | grep 'ID=')
if [[ $detect == *"debian"* ]]; then
sudo apt-get update
sudo apt-get install clamav
sudo sed -i -e "s/^Example/#Example/" /etc/freshclam.conf
apt-get update
apt-get install clamav
sed -i -e "s/^Example/#Example/" /etc/freshclam.conf
elif [[ $detect == *"ubuntu"* ]]; then
sudo apt-get update
sudo apt-get install clamav
sudo sed -i -e "s/^Example/#Example/" /etc/freshclam.conf
apt-get update
apt-get install clamav
sed -i -e "s/^Example/#Example/" /etc/freshclam.conf
elif [[ $detect == *"centos"* ]]; then
sudo yum install -y epel-release
sudo yum install -y clamav
sudo sed -i -e "s/^Example/#Example/" /etc/freshclam.conf
yum install -y epel-release
yum install -y clamav
sed -i -e "s/^Example/#Example/" /etc/freshclam.conf
elif [[ $detect == *"alpine"* ]]; then
sudo apk add clamav
sudo sed -i -e "s/^Example/#Example/" /etc/clamav/freshclam.conf
apk add clamav
sed -i -e "s/^Example/#Example/" /etc/clamav/freshclam.conf
fi

sudo freshclam
sudo touch /var/log/clamav/clamav.log
sudo chgrp clamupdate /var/log/clamav/clamav.log
sudo chmod 1755 /var/log/clamav/clamav.log
freshclam
mkdir /var/log/clamav
touch /var/log/clamav/clamav.log
chgrp clamupdate /var/log/clamav/clamav.log
chmod 1755 /var/log/clamav/clamav.log

0 comments on commit b37b7bd

Please # to comment.