Skip to content

Instantly share code, notes, and snippets.

@xurizaemon
Forked from proffalken/DEBIAN_GHOST_CHECKER.sh
Created January 30, 2015 21:03
Show Gist options
  • Save xurizaemon/dfafd6d9f1ad8fe3f5e2 to your computer and use it in GitHub Desktop.
Save xurizaemon/dfafd6d9f1ad8fe3f5e2 to your computer and use it in GitHub Desktop.
#!/bin/bash
## Thanks to https://gist.github.com/xurizaemon for sorting this version out for me! :)
DEB_OR_UBU=$(lsb_release -ds | cut -d " " -f 1)
INSTALLED_VERSION=$(dpkg -s libc6 | grep Version | awk '{ print $2 }')
FIXED_VERSION=""
if [ "$DEB_OR_UBU" == "Ubuntu" ]; then
UBUNTU_RELEASE=$(lsb_release -sr | cut -d '.' -f 1)
case $UBUNTU_RELEASE in
10)
FIXED_VERSION=2.11.1-0ubuntu7.20 ;;
12)
FIXED_VERSION=2.15-0ubuntu10.10 ;;
14)
FIXED_VERSION=2.19-0ubuntu6 ;;
esac
else
DEBIAN_RELEASE=$(lsb_release -sr | cut -c 1)
case $DEBIAN_RELEASE in
6)
FIXED_VERSION=2.11.3-4+deb6u4 ;;
7)
FIXED_VERSION=2.13-38+deb7u7 ;;
8)
FIXED_VERSION=2.19-13 ;;
esac
fi
dpkg --compare-versions $INSTALLED_VERSION ge $FIXED_VERSION
if [ ! $? -eq 0 ] ; then
echo Installed is $INSTALLED_VERSION, should be $FIXED_VERSION
exit 2
else
echo Installed is $INSTALLED_VERSION, looks OK.
exit 0
fi
#!/bin/bash
RH_VER=$(cat /etc/redhat-release | cut -d " " -f 3 | cut -d "." -f 1 )
if [ "$RH_VER" == "5" ]; then
GOOD_VER="glibc-2.5-123.el5_11.1"
fi
if [ "$RH_VER" == "6" ] || [ "$RH_VER" == "7" ]; then
GOOD_VER="glibc-2.12-1.149.el6_6.5"
fi
CURRENT_VERSION=$(rpm -qa | grep glibc-2 | cut -d "." -f -5)
if [ "$CURRENT_VERSION" != "$GOOD_VER" ]; then
echo "CURRENT VERSION IS $CURRENT_VERSION - SHOULD BE $GOOD_VER"
exit 2
else
echo "CURRENT VERSION ( $CURRENT_VERSION ) IS OK"
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment