Last active
August 29, 2015 14:10
-
-
Save jacks205/2f5cf05b0fab81b46076 to your computer and use it in GitHub Desktop.
Bash script to restart server on crash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://www.digitalocean.com/community/tutorials/how-to-use-a-simple-bash-script-to-restart-server-programs | |
#!/bin/sh | |
ps auxw | grep apache2 | grep -v grep > /dev/null | |
if [ $? != 0 ] | |
then | |
/etc/init.d/apache2 start > /dev/null | |
fi | |
#chmod +x launch.sh | |
#crontab -e | |
#* * * * * ~/launch.sh | |
#*/5 * * * * ~/launch.sh | |
#timestamp | |
timestamp(){ | |
(date) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment