#Append this to bottom of AEM or CQ's stops script.
Last active
August 29, 2015 14:14
-
-
Save toodooleedoo/9d138bb3807b94da3023 to your computer and use it in GitHub Desktop.
#AEM #CQ #LINUX Shutdown Script Enhancement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################## | |
# | |
# CUSTOM | |
# Wait for server to return successful validation | |
# | |
# Eric Soukenka - 03Nov2014 | |
# | |
######################################################################## | |
TIMELIMIT=$((SECONDS+120)) | |
until $(ps aux |grep -E "([a]uthor -jar|[p]ublish -jar)" >/dev/null); do | |
printf '.'; | |
sleep 2; | |
if [ $SECONDS -gt $TIMELIMIT ]; then | |
echo ""; | |
echo "Waited ${SECONDS} seconds however process still running. Exiting now."; | |
exit | |
fi | |
break; | |
done | |
echo ""; | |
echo "Shutdown Completed successfully in ${SECONDS} seconds"; | |
###END BWI CUSTOM | |
exit ${STOP_CODE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment