Skip to content

Instantly share code, notes, and snippets.

@jacks205
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacks205/2f5cf05b0fab81b46076 to your computer and use it in GitHub Desktop.
Save jacks205/2f5cf05b0fab81b46076 to your computer and use it in GitHub Desktop.
Bash script to restart server on crash
#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