#!/bin/sh
while :do PID=`cat /home/pid.file` RUN_FLAG=`ps -p $PID | awk -v var=$PID '$1==var { print "1" }'` if [ -n "$RUN_FLAG" ] # string is not "null". then echo 'running' # running else echo 'kao' # restart process fi sleep 60 # 1 minutedone
posted on 2007-07-09 21:47 waterye 阅读(1082) 评论(0) 编辑 收藏 所属分类: Linux
Powered by: BlogJava Copyright © waterye