Summary of changes:
Add grep in while loops so if box PANICs test doesn't get stuck.
Use egrep instead of grep so checks that test has failed is correct.
  (grep on debian is egrep, grep on redhat is different to egrep)
Fix start order in check_fakesmsc (1bearerbox 2smsbox 3fakesmsc) as Alex suggests.

James.
diff -Naur --exclude=CVS gateway-cvshead/checks/check_fakesmsc.sh 
gateway/checks/check_fakesmsc.sh
--- gateway-cvshead/checks/check_fakesmsc.sh    2004-07-07 17:55:46.000000000 +0100
+++ gateway/checks/check_fakesmsc.sh    2004-07-08 11:12:24.000000000 +0100
@@ -14,12 +14,12 @@
 
 sleep 2
 
-test/fakesmsc -i $interval -m $times '123 234 text nop' \
-    > check_fakesmsc.log 2>&1 &
+gw/smsbox -v $loglevel gw/smskannel.conf > check_fakesmsc_sms.log 2>&1 &
 
 sleep 1
 
-gw/smsbox -v $loglevel gw/smskannel.conf > check_fakesmsc_sms.log 2>&1 &
+test/fakesmsc -i $interval -m $times '123 234 text nop' \
+    > check_fakesmsc.log 2>&1 &
 
 running=yes
 while [ $running = yes ]
@@ -29,12 +29,19 @@
     then
        running=no
     fi
+    if grep "PANIC:" check_fakesmsc.log >/dev/null
+    then
+       running=no
+    fi
 done
 
-kill -INT $bbpid
-wait
+if ! grep "PANIC:" check_fakesmsc.log >/dev/null
+then
+    kill -INT $bbpid
+    wait
+fi
 
-if grep 'WARNING:|ERROR:|PANIC:' check_fakesmsc*.log >/dev/null
+if egrep 'ERROR:|PANIC:' check_fakesmsc*.log >/dev/null
 then
        echo check_fakesmsc.sh failed 1>&2
        echo See check_fakesmsc*.log for info 1>&2
@@ -43,4 +50,4 @@
 
 rm check_fakesmsc*.log
 
-exit 0
\ No newline at end of file
+exit 0
diff -Naur --exclude=CVS gateway-cvshead/checks/check_smpp.sh 
gateway/checks/check_smpp.sh
--- gateway-cvshead/checks/check_smpp.sh        2003-02-13 10:35:26.000000000 +0000
+++ gateway/checks/check_smpp.sh        2004-07-08 12:31:16.000000000 +0100
@@ -21,12 +21,16 @@
     then
         running=no
     fi
+    if grep "PANIC:" check_smpp*.log >/dev/null
+    then
+       running=no
+    fi
 done
 sleep 5
 
 kill -INT $bbpid
 
-if grep 'WARNING:|ERROR:|PANIC:' check_smpp*.log >/dev/null
+if egrep 'WARNING:|ERROR:|PANIC:' check_smpp*.log >/dev/null
 then
         echo check_smpp.sh failed 1>&2
         echo See check_smpp*.log for info 1>&2

Reply via email to