I am writing a shell script and here is the snippet ..
sudo service httpd restart --- ( 1)
if [ $? -eq 0 ]; then
# Now configure php.ini using sed command
sudo sed -i 's_;date.timezone =_date.timezone = "Asia/Kolkata"_' /etc/php.ini
# Now restart the httpd server again
sudo service httpd restart ---- This statement throws error
When I ran above script then I got error Address already in use: make_sock: could not bind to address at second sudo service httpd restart statement.
I doubt it is because when first time sudo service httpd restart runs , before it finishes completely second 'sudo service httpd restart' runs.
So how can I test surely If first sudo service httpd restart finishes then only rest of the code execute.
I hope I am understandable ..
Thanks