Skip to content

Instantly share code, notes, and snippets.

@xurizaemon
Forked from proffalken/DEBIAN_GHOST_CHECKER.sh
Last active August 29, 2015 14:14
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 xurizaemon/2298c9d808043a973d7a to your computer and use it in GitHub Desktop.
Save xurizaemon/2298c9d808043a973d7a to your computer and use it in GitHub Desktop.
Updated for different libc6 versions for Debian releases
#!/bin/bash
# The original @ https://gist.github.com/proffalken/08e9649ee7083fc3c5bd has been updated to
# include these changes and adds support for Ubuntu. Use that version again now.
INSTALLED_VERSION=$(dpkg -s libc6 | grep Version | awk '{ print $2 }')
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
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