Skip to content

Instantly share code, notes, and snippets.

@toodooleedoo
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save toodooleedoo/bc1ed64491fbfc3499ad to your computer and use it in GitHub Desktop.
Save toodooleedoo/bc1ed64491fbfc3499ad to your computer and use it in GitHub Desktop.
#AEM #CQ #LINUX Startup Script Enhancement

#Place at the bottom of the AEM or CQ Start script.

########################################################################
#
# BWI Custom
# Wait for server to return successful validation
#
# Eric Soukenka - 03Nov2014
#
########################################################################
TIMELIMIT=$((SECONDS+120))
echo "Waiting for server validation. Ctrl+C to skip.";
until $(curl --silent "http://localhost:4502/libs/granite/core/content/login.html" |grep "QUICKSTART_HOMEPAGE" >/dev/null); do
printf '.';
sleep 2;
if [ $SECONDS -gt $TIMELIMIT ]; then
echo "";
echo "Waited ${SECONDS} seconds however validation has failed. Exiting now.";
exit
fi
done
echo "";
echo "Startup completed successfully in ${SECONDS} seconds";
###END BWI CUSTOM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment