Created
November 27, 2014 02:50
-
-
Save linwiz/70f28d43926c47ea976e to your computer and use it in GitHub Desktop.
clamav-upgrade
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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