I am trying to create a user-friendly means of restarting all relevant services on a CentOS server. The script appears below. So far, all of it works EXCEPT - it seems to shut down tomcat and then does not start it back up. When the script is run, it prompts the first time for a password. After that, all other commands are run as su (sudo), and do not prompt for a password. The command throw no errors. If I run the sudo commands for tomcat manually, they work fine, but in this script, tomcat (lucee) never starts back up. Anyone care to take a whack at why?
sudo echo "WEB DEV SERVICE RESTARTS"
clear
echo
echo ------------------------- STOPPING -------------------------
echo "Stopping Apache..."
sudo apachectl stop
sleep 2
echo "done."
echo
echo "Stopping Tomcat/Lucee..."
sudo /opt/lucee/tomcat/bin/shutdown.sh
sleep 2
echo "done."
echo
echo "Stopping MySQL..."
sudo systemctl stop mariadb
sleep 3
echo "done."
echo
echo
echo ------------------------- STARTING -------------------------
echo "Starting Apache..."
sudo apachectl start
sleep 2
echo "done."
echo
echo "Starting Tomcat/Lucee..."
sudo /opt/lucee/tomcat/bin/startup.sh
sleep 2
echo "done."
echo
echo "Starting MySQL..."
sudo systemctl start mariadb
sleep 2
echo "done."
echo
sleep 3