分类:
2008-12-08 21:27:42
#!/bin/bash # Apache Process Monitor # Restart Apache Web Server When It Goes Down # ------------------------------------------------------------------------- # Copyright (c) 2003 nixCraft project < # This script is licensed under GNU GPL version 2.0 or above # ------------------------------------------------------------------------- # RHEL / CentOS / Fedora Linux restart command RESTART="service httpd restart" # uncomment if you are using Debian / Ubuntu Linux #RESTART="/etc/init.d/apache2 restart" #path to pgrep command PGREP="/usr/bin/pgrep" # find httpd pid $PGREP httpd if [ $? -eq 0 ] then # restart apache $RESTART fi