#/bin/bashset -x HOSTS="mysql tomcat"for myhost in $HOSTS do count=(`ps aux |grep $myhost |grep -v grep |wc -l`) echo "$myhost" echo "$count"if [ $count -eq 0 ]; then case $myhost in tomcat) cd /bin/ ./startup.sh echo "tomcat has be down" sleep 5 ;; mysql) /etc/init.d/mysqld start echo "mysql has be down" ;; *) echo "what‘s the hell?" ;;esac fidoneset +x
posted on 2012-04-24 23:23
kxbin 阅读(226)
评论(0) 编辑 收藏 所属分类:
Linux