Skip to content

Instantly share code, notes, and snippets.

@amussey
Last active August 29, 2015 14:07
Show Gist options
  • Save amussey/fd6f06d41ab816eff817 to your computer and use it in GitHub Desktop.
Save amussey/fd6f06d41ab816eff817 to your computer and use it in GitHub Desktop.
#!/bin/bash
# command -v lsb_release >/dev/null 2>&1 || { echo "This script requires lsb_release, but the command is not available." >&2; exit 1; }
# echo -e "This script will need to be run as root. To view the source of this script, visit:\n"
YOUR_INSTALL=$(head -1 /etc/issue | sed 's/ \\n \\l//')
if [ "$YOUR_INSTALL" = "Ubuntu 10.04" ] ; then
echo "Ubuntu 10.04"
elif [ "$YOUR_INSTALL" = "Ubuntu 11.04" ] ; then
echo "Ubuntu 11.04"
elif [ "$YOUR_INSTALL" = "Ubuntu 11.10" ] ; then
echo "Ubuntu 11.10"
elif [ "$YOUR_INSTALL" = "Ubuntu 12.04" ] ; then
echo "Ubuntu 12.04"
elif [ "$YOUR_INSTALL" = "Ubuntu 12.10" ] ; then
echo "Ubuntu 12.10"
elif [ "$YOUR_INSTALL" = "Ubuntu 13.04" ] ; then
echo "Ubuntu 13.04"
elif [ "$YOUR_INSTALL" = "Ubuntu 13.10" ] ; then
echo "Ubuntu 13.10"
elif [ "$YOUR_INSTALL" = "Ubuntu 14.04" ] ; then
echo "Ubuntu 14.04"
elif [ "$YOUR_INSTALL" = "Debian GNU/Linux 6.0" ] ; then
echo "Debian 6.0"
elif [ "$YOUR_INSTALL" = "Debian GNU/Linux 7" ] ; then
echo "Debian 7.0"
elif [[ "$YOUR_INSTALL" =~ "Debian GNU/Linux jessie" ]] ; then
echo "Debian Jessie"
echo "Unfortunately, your operating system is not yet supported by the Rackspace Monitoring Agent."
exit 1
elif [[ "$YOUR_INSTALL" =~ "Fedora release 19" ]] ; then
echo "Fedora 19"
elif [[ "$YOUR_INSTALL" =~ "Fedora release 20" ]] ; then
echo "Fedora 20"
elif [[ "$YOUR_INSTALL" =~ "Red Hat Enterprise Linux Server release 5" ]] ; then
echo "Fedora 19"
elif [[ "$YOUR_INSTALL" =~ "CentOS release 6.5" ]] ; then
echo "CentOS 6.5"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment