Created
August 21, 2014 20:13
-
-
Save josue/2043b3ba8aeff694e684 to your computer and use it in GitHub Desktop.
Checks if client services (ElasticSearch + background jobs) are running
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
#!/bin/sh | |
CLIENT=$1 | |
DIR_DEPLOY="/var/www/vhosts/deploy" | |
CLIENT_DIR="$DIR_DEPLOY/$CLIENT" | |
echo "- Switching to client dir: $CLIENT_DIR" | |
cd $CLIENT_DIR | |
echo | |
ELASTIC=`ps aux | grep java | grep elastic | grep -v grep | awk '{ print $2 }'` | |
if [ "$ELASTIC" != "" ]; then | |
echo "- Elastic is Running" | |
else | |
echo "> Starting Elastic ..." | |
sh app/vendors/elasticsearch-0.90.2/bin/elasticsearch | |
fi | |
echo | |
echo "> Restart background-jobs for client: $CLIENT" | |
sh app/vendors/service-background-jobs.sh restart | |
echo | |
echo "- DONE" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Download and install within you VM:
Usage:
# client-startup walmart