有點用的linux shell 指令碼

wangzhensheng發表於2007-05-31

while (:) ;do echo "httpd ->` ps -ef | grep -v grep | grep httpd | wc -l`";sleep 1 ;done

pnum=0;if [ "$pnum" -eq "0" ]; then echo "ok" ; else echo "no ok ..." ;fi

[@more@]

#!/bin/sh
# ping shell
echo '219.238.182.1'>./.ip
echo '219.238.182.10'>>./.ip
echo '219.238.182.62'>>./.ip

echo '#!/bin/sh'>./p
echo '#pshell'>>./p
echo 'while read LINE'>>./p
echo 'do'>>./p
echo 'echo "${LINE} `ping -c1 ${LINE}|tail +2 | grep '^64'|grep -v grep|wc - l`"'>>./p
echo 'done<.>>./p

while (:) ;do echo "httpd ->` ps -ef | grep -v grep | grep httpd | wc -l`";sleep 1 ;done

pnum=0;if [ "$pnum" -eq "0" ]; then echo "ok" ; else echo "no ok ..." ;fi

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8806316/viewspace-916916/,如需轉載,請註明出處,否則將追究法律責任。

相關文章