Skip to content

Instantly share code, notes, and snippets.

@linwiz
Created November 27, 2014 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linwiz/70f28d43926c47ea976e to your computer and use it in GitHub Desktop.
Save linwiz/70f28d43926c47ea976e to your computer and use it in GitHub Desktop.
clamav-upgrade
#!/bin/bash
# clamav "install the latest version from official source" script
# You should probably uninstall clamav prior to running this,
# but you don't have to. Enjoy!
# Usage:
# clamav-upgrade 0.98.5 # upgrade to version 0.98.5
if [[ -z $1 ]]; then
printf "Please provide the clamav version in the following format\n \
(should match the sourceforge website): 0.98.5\n"
exit
fi
result=`wget -nv "http://tcpdiag.dl.sourceforge.net/project/clamav/clamav/$1/clamav-$1.tar.gz" -o /tmp/404.txt; grep "404: Not Found" /tmp/404.txt`
printf "Checking if download url is correct: "
if (grep "404: Not Found" /tmp/404.txt 1>/dev/null 2>&1);
then
printf "Failure!\nThis url is not correct. Please verify your clamav version and try again\n"
printf "http://tcpdiag.dl.sourceforge.net/project/clamav/clamav/$1/clamav-$1.tar.gz\n"
exit
else
printf "Success!\n"
tar -zxf "clamav-$1.tar.gz"
cd clamav-$1
./configure
make
sudo make install
fi
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment