Chinaunix首页 | 论坛 | 博客
  • 博客访问: 375438
  • 博文数量: 87
  • 博客积分: 2810
  • 博客等级: 少校
  • 技术积分: 825
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-28 22:34
文章分类

全部博文(87)

文章存档

2010年(25)

2009年(43)

2008年(19)

分类:

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
阅读(901) | 评论(0) | 转发(0) |
0

上一篇:Sudo

下一篇:读取IP 地址

给主人留下些什么吧!~~