Skip to content

Instantly share code, notes, and snippets.

@omega8cc
Created July 26, 2010 22:28
Show Gist options
  • Save omega8cc/491353 to your computer and use it in GitHub Desktop.
Save omega8cc/491353 to your computer and use it in GitHub Desktop.
_RESOLVEIP=`resolveip $AEGIR_HOST 2> /dev/null`
if [ -z $_RESOLVEIP ] ; then
msg "This server does not have a hostname that resolves to an IP address"
exit 1
else
AEGIR_HOST_IP=`echo $_RESOLVEIP | cut -d: -f2 | awk '{ print $6}'`
true
fi
_MYSQLTEST=`mysql -h$AEGIR_HOST_IP -uINVALIDLOGIN -pINVALIDPASS 2>&1 >/dev/null | cat`
if [ -z `echo $_MYSQLTEST | grep -q "ERROR 2003"` ] ; then
msg "MySQL is listening on $AEGIR_HOST_IP."
true
else
msg "MySQL is not configured to listen on $AEGIR_HOST_IP."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment