Last active
August 29, 2015 14:03
-
-
Save mig5/50bd258caf1cf8d2ced2 to your computer and use it in GitHub Desktop.
OSSEC quick install script
This file contains hidden or 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 | |
# | |
# Written by mig5 2014 | |
# Variables | |
VERSION=2.8.2 | |
CHECKSUM="ossec-hids-${VERSION}-checksum.txt" | |
TARBALL="ossec-hids-${VERSION}.tar.gz" | |
echo "Downloading packages and checksums" | |
curl -o ${TARBALL} http://www.ossec.net/files/${TARBALL} | |
curl -o ${CHECKSUM} http://www.ossec.net/files/${CHECKSUM} | |
echo "These are the checksums from the file" | |
cat $CHECKSUM | |
OSSEC_MD5=$(md5sum $TARBALL | awk {'print $1'}) | |
OSSEC_SHA=$(sha1sum $TARBALL | awk {'print $1'}) | |
echo "checking for matching md5/sha sums" | |
grep $OSSEC_MD5 $CHECKSUM | |
if [ $? -eq 1 ]; then | |
echo "md5sum didn't match"! | |
exit 1 | |
fi | |
grep $OSSEC_SHA $CHECKSUM | |
if [ $? -eq 1 ]; then | |
echo "sha1sum didn't match"! | |
exit 1 | |
fi | |
# sums matched, extract and run install | |
tar zxfv $TARBALL | |
builtin cd ossec-hids-${VERSION} | |
sudo bash install.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment