I want to setup a script which will connect to a linux server and then stop/start a service. But between the stop and start of the service, it should wait ~10 seconds and check if the service is really stopped.
service httpd stop
--wait 10 seconds. check ps -ef | grep httpd, kill if any hanged processes
service httpd start
Please can someone help me on how to do it?