Bash Script To Restart Linux Server Services Rumi, December 21, 2021 Here’s the command line code to create the file in nano: sudo nano /opt/launch-crashed-services.sh Here is the bash script. #!/bin/bash service mysql status | grep ‘active (running)’ > /dev/null 2>&1 if [ $? != 0 ] then sudo service mysql restart > /dev/null fi service nginx status | grep ‘active… Continue Reading