标签:
#!/bin/sh MAXRSTCOUNT=5; PROCTOGO=/mnt/hgfs/code/test/show #count is the counter of test started times count=0 sys_reboot() { echo "system is going to reboot"; reboot; } main_loop() { while : do ######################################### ProStillRunning=$(ps -aux |grep "${PROCTOGO}" |grep -v "grep") if [ -z "$ProStillRunning" ]; then #start test chmod +x ${PROCTOGO} ${PROCTOGO} fi #the running times counter let count=count+1 echo "test running times is $count" #wait for test stoping... sleep 3 ######################################### done } main_loop;
标签:
原文地址:http://www.cnblogs.com/mylinux/p/5555926.html