need help with remote ssh script
I have a Tomcat service running on a remote server. What i would like to do is run a script so that it will stop the tomcat service, check to make sure it is stopped, then remove my war file and replace it with the latest version.
I have this working for the most part, my struggle is verifying that the service is stopped. My initial thought was to do if then else, but i'm not sure how to send that command through ssh. i dont think its possible. so here is what i do now. Code:
ssh admin@$BOX.com "/bin/Tomcat7.sh stop" |
How about using Inotify to watch the directory where you copy the .war file to and make it execute a script that stops Tomcat, replaces the .war file, starts Tomcat and greps last 500 log lines for common errors? That way the only thing you need to do to trigger a replacement is send the file over.
|
Quote:
stop should wait for the service to end. If you do need a loop, wait on the pid file being removed instead. |
you could also do something along this line:
Code:
killProcs () Code:
startProcs() |
Quote:
Code:
killProcs() { |
All times are GMT -5. The time now is 08:34 PM. |