]> arthur.barton.de Git - ngircd.git/commitdiff
Test suite: clean up scripts
authorAlexander Barton <alex@barton.de>
Sun, 31 Mar 2024 17:53:16 +0000 (19:53 +0200)
committerAlexander Barton <alex@barton.de>
Fri, 5 Apr 2024 21:16:07 +0000 (23:16 +0200)
- Reformat code.
- Cleanup some glitches, streamline scripts ...
- Enable "set -u": Error on unset variables.
- Detect "$srcdir" in prep-server3 script, too.

15 files changed:
src/testsuite/getpid.sh
src/testsuite/prep-server3
src/testsuite/reload-server.sh
src/testsuite/start-server.sh
src/testsuite/start-server1
src/testsuite/start-server2
src/testsuite/start-server3
src/testsuite/stop-server.sh
src/testsuite/stop-server1
src/testsuite/stop-server2
src/testsuite/stop-server3
src/testsuite/stress-server.sh
src/testsuite/test-loop.sh
src/testsuite/tests.sh
src/testsuite/wait-tests.sh

index 04708e6c27ad7d6ccb9bad9a78786ee1976e1b75..55997ad825efffffb4b48db7fda577ff5e641797 100755 (executable)
@@ -1,29 +1,31 @@
 #!/bin/sh
 # ngIRCd Test Suite
 
+set -u
+
 # did we get a name?
 [ $# -ne 1 ] && exit 1
 
-[ -x /bin/pidof ] && exec /bin/pidof -s $@
+[ -x /bin/pidof ] && exec /bin/pidof -s "$1"
 
 # detect flags for "ps" and "head"
 UNAME=`uname`
 if [ $UNAME = "FreeBSD" ]; then
-  PS_FLAGS="-a"; PS_PIDCOL="1"; HEAD_FLAGS="-n 1"
+       PS_FLAGS="-a"; PS_PIDCOL="1"; HEAD_FLAGS="-n 1"
 elif [ $UNAME = "A/UX" ]; then
-  PS_FLAGS="-af"; PS_PIDCOL="2"; HEAD_FLAGS="-1"
+       PS_FLAGS="-af"; PS_PIDCOL="2"; HEAD_FLAGS="-1"
 elif [ $UNAME = "GNU" ]; then
-  PS_FLAGS="-ax"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
+       PS_FLAGS="-ax"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
 elif [ $UNAME = "Haiku" ]; then
-  PS_FLAGS="-o Id -o Team"; PS_PIDCOL="1"; HEAD_FLAGS="-1"
+       PS_FLAGS="-o Id -o Team"; PS_PIDCOL="1"; HEAD_FLAGS="-1"
 elif [ $UNAME = "Linux" ]; then
-  PS_FLAGS="ax"; PS_PIDCOL="1"; HEAD_FLAGS="-n 1"
+       PS_FLAGS="ax"; PS_PIDCOL="1"; HEAD_FLAGS="-n 1"
 elif [ $UNAME = "SunOS" ]; then
-  PS_FLAGS="-af"; PS_PIDCOL=2; HEAD_FLAGS="-n 1"
+       PS_FLAGS="-af"; PS_PIDCOL=2; HEAD_FLAGS="-n 1"
 else
-  PS_FLAGS="-af"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
-  ps $PS_FLAGS > /dev/null 2>&1
-  if [ $? -ne 0 ]; then PS_FLAGS="a"; PS_PIDCOL="1"; fi
+       PS_FLAGS="-af"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
+       ps $PS_FLAGS >/dev/null 2>&1
+       if [ $? -ne 0 ]; then PS_FLAGS="a"; PS_PIDCOL="1"; fi
 fi
 
 # debug output
@@ -33,19 +35,16 @@ fi
 #echo "$0: HEAD_FLAGS=$HEAD_FLAGS"
 
 # search PID
-ps $PS_FLAGS > procs.tmp
+ps $PS_FLAGS >procs.tmp
 cat procs.tmp | \
-  grep -v "$0" | grep "$1" | \
-  awk "{print \$$PS_PIDCOL}" | \
-  sort -n > pids.tmp
+       grep -v "$0" | grep "$1" | \
+       awk "{print \$$PS_PIDCOL}" | \
+       sort -n >pids.tmp
 pid=`head $HEAD_FLAGS pids.tmp`
 rm -rf procs.tmp pids.tmp
 
 # validate PID
-[ "$pid" -gt 1 ] > /dev/null 2>&1
-[ $? -ne 0 ] && exit 1
+[ "$pid" -gt 1 ] >/dev/null 2>&1 || exit 1
 
 echo $pid
 exit 0
-
-# -eof-
index 6d389536e68f664f6e214de8f9a5073c3feb9521..c76b25029028f09a1b6e2fe0d480a72ae6801d66 100755 (executable)
@@ -1,4 +1,6 @@
 #!/bin/sh -e
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -eu
 mkdir -p ssl
 cp "${srcdir}"/ssl/cert-my-first-domain-tld.pem ssl/cert.pem
 cp "${srcdir}"/ssl/key-my-first-domain-tld.pem ssl/key.pem
index 1f82d8eb8dd50c8e9cc1fd12f7cf88481642a1bb..8d6fd2bc0370bad8e7858c222f13f68194ffe254 100755 (executable)
@@ -1,10 +1,11 @@
 #!/bin/sh
 # ngIRCd Test Suite
 
-[ -z "$srcdir" ] && srcdir=`dirname $0`
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
 
 # read in functions
-. ${srcdir}/functions.inc
+. "${srcdir}/functions.inc"
 
 if [ -n "$1" ]; then
        id="$1"; shift
@@ -17,16 +18,14 @@ echo_n "reloading server ${id} ..."
 # reload (sighup) test-server ...
 pid=`./getpid.sh T-ngircd${id}`
 if [ -z "$pid" ]; then
-  echo " failure: no running server found!?"
-  exit 1
+       echo " failure: no running server found!?"
+       exit 1
 fi
-kill -HUP $pid > /dev/null 2>&1; r=$?
+kill -HUP $pid >/dev/null 2>&1; r=$?
 if [ $r -eq 0 ]; then
-  sleep 2
-  echo " ok".
-  kill -0 $pid && exit 0
+       sleep 2
+       echo " ok".
+       kill -0 $pid && exit 0
 fi
 echo " failure: server ${id} could not be reloaded!"
 exit 1
-
-# -eof-
index 3d19ffb5997f795fe2dea8d0b421f6b87a49bf0d..599bf3ad7a5c678c4fb9fa56f126bca21485960c 100755 (executable)
@@ -1,10 +1,11 @@
 #!/bin/sh
 # ngIRCd Test Suite
 
-[ -z "$srcdir" ] && srcdir=`dirname $0`
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
 
 # read in functions
-. ${srcdir}/functions.inc
+. "${srcdir}/functions.inc"
 
 if [ -n "$1" ]; then
        id="$1"; shift
@@ -19,36 +20,34 @@ echo_n "starting server ${id} ..."
 
 # check weather getpid.sh returns valid PIDs. If not, don't start up the
 # test-server, because we won't be able to kill it at the end of the test.
-./getpid.sh sh > /dev/null 2>&1
+./getpid.sh sh >/dev/null 2>&1
 if [ $? -ne 0 ]; then
-  echo " getpid.sh failed!"
-  exit 1
+       echo " getpid.sh failed!"
+       exit 1
 fi
 
 # check if there is a test-server already running
 ./getpid.sh T-ngircd${id} >/dev/null 2>&1
 if [ $? -eq 0 ]; then
-  echo " failure: test-server ${id} already running!"
-  exit 1
+       echo " failure: test-server ${id} already running!"
+       exit 1
 fi
 
 # generate MOTD for test-server
-echo "This is an ngIRCd Test Server" > ngircd-test${id}.motd
+echo "This is an ngIRCd Test Server" >ngircd-test${id}.motd
 
 # glibc memory checking, see malloc(3)
 MALLOC_CHECK_=3
 export MALLOC_CHECK_
 
 # starting up test-server ...
-./T-ngircd${id} -n -f ${srcdir}/ngircd-test${id}.conf $* \
+./T-ngircd${id} -n -f "${srcdir}/ngircd-test${id}.conf" "$@" \
  >ngircd-test${id}.log 2>&1 &
 sleep 1
 
 # validate running test-server
+r=1
 pid=`./getpid.sh T-ngircd${id}`
-[ -n "$pid" ] && kill -0 $pid > /dev/null 2>&1; r=$?
-
+[ -n "$pid" ] && kill -0 $pid >/dev/null 2>&1; r=$?
 [ $r -eq 0 ] && echo " ok." || echo " failure!"
 exit $r
-
-# -eof-
index 7fb4e94caa58c86fc10383b5260a1d05090b8f6d..ced37c47ee67cce0c3207f8a4e184d4c469d8e3f 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/sh
 # ngIRCd Test Suite
 
-[ -z "$srcdir" ] && srcdir=`dirname $0`
-${srcdir}/start-server.sh 1
-
-# -eof-
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
+"${srcdir}/start-server.sh" 1
index 2c4ffa6b332729d57651ca7224e97efdd8dbdfd1..ca05bcf661c45cc09c70ca857404d5ad549158a2 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/sh
 # ngIRCd Test Suite
 
-[ -z "$srcdir" ] && srcdir=`dirname $0`
-${srcdir}/start-server.sh 2
-
-# -eof-
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
+"${srcdir}/start-server.sh" 2
index b9043f4354c3a50c777c877f01ef32571e786bbd..167040b50cb5f0bb08589f152df78542335bf836 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # ngIRCd Test Suite
 
-[ -z "$srcdir" ] && srcdir=`dirname $0`
-${srcdir}/start-server.sh 3
-# -eof-
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
+"${srcdir}/start-server.sh" 3
index c531137e2b10843f44db65f435085905b5bd38ab..c5a9486c4797a90a1a66c8fb10088be4cc479f6d 100755 (executable)
@@ -1,10 +1,11 @@
 #!/bin/sh
 # ngIRCd Test Suite
 
-[ -z "$srcdir" ] && srcdir=`dirname $0`
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
 
 # read in functions
-. ${srcdir}/functions.inc
+. "${srcdir}/functions.inc"
 
 if [ -n "$1" ]; then
        id="$1"; shift
@@ -17,21 +18,19 @@ echo_n "stopping server ${id} ..."
 # stop test-server ...
 pid=`./getpid.sh T-ngircd${id}`
 if [ -z "$pid" ]; then
-  echo " failure: no running server found!?"
-  exit 1
+       echo " failure: no running server found!?"
+       exit 1
 fi
-kill $pid > /dev/null 2>&1 || exit 1
+kill $pid >/dev/null 2>&1 || exit 1
 
 # waiting ...
 for i in 1 2 3 4 5; do
-  kill -0 $pid > /dev/null 2>&1; r=$?
-  if [ $r -ne 0 ]; then
-    echo " ok".
-    exit 0
-  fi
-  sleep 1
+       kill -0 $pid >/dev/null 2>&1; r=$?
+       if [ $r -ne 0 ]; then
+               echo " ok".
+               exit 0
+       fi
+       sleep 1
 done
 echo " failure: server ${id} still running!?"
 exit 1
-
-# -eof-
index 9b562076f4dc129f1688ed7c8a4df46cadcced80..aad0c851d9bafa9e76f1e95903693c5cae4557c4 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/sh
 # ngIRCd Test Suite
 
-[ -z "$srcdir" ] && srcdir=`dirname $0`
-${srcdir}/stop-server.sh 1
-
-# -eof-
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
+"${srcdir}/stop-server.sh" 1
index 304d174960a4f2ed5e34007633ba8d88106f6824..104a096c907ab1ce194315f65523a37d3bb77057 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/sh
 # ngIRCd Test Suite
 
-[ -z "$srcdir" ] && srcdir=`dirname $0`
-${srcdir}/stop-server.sh 2
-
-# -eof-
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
+"${srcdir}/stop-server.sh" 2
index d7487693fb322d676844a8ffebdd2c958bb718f5..a9515ed0feb82331fbebd520b600e1a68dafbd86 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/sh
 # ngIRCd Test Suite
 
-[ -z "$srcdir" ] && srcdir=`dirname $0`
-${srcdir}/stop-server.sh 3
-
-# -eof-
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
+"${srcdir}/stop-server.sh" 3
index 1e823253cd3a0c093ee88f65e8d3c61bab9ef8a6..a9ef50763919fe7c3635a687b53a0b7f9c8f8ae1 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # ngIRCd Test Suite
-# Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
+# Copyright (c)2001-2024 Alexander Barton (alex@barton.de) and Contributors.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # Please read the file COPYING, README and AUTHORS for more information.
 #
 
-# detect source directory
-[ -z "$srcdir" ] && srcdir=`dirname $0`
-
 # parse command line
-[ "$1" -gt 0 ] 2> /dev/null && CLIENTS="$1" || CLIENTS=5
-[ "$2" -gt 0 ] 2> /dev/null && MAX="$2" || MAX=-1
+[ "$1" -gt 0 ] 2>/dev/null && CLIENTS="$1" || CLIENTS=5
+[ "$2" -gt 0 ] 2>/dev/null && MAX="$2" || MAX=-1
+
+# detect source directory
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
 
 # get our name
-name=`basename $0`
+name=`basename "$0"`
 
 # create directories
 [ -d logs ] || mkdir logs
 [ -d tests ] || mkdir tests
 
 # test for required external tools
-type expect > /dev/null 2>&1
+type expect >/dev/null 2>&1
 if [ $? -ne 0 ]; then
-  echo "${name}: \"expect\" not found.";  exit 77
+       echo "${name}: \"expect\" not found."
+       exit 77
 fi
-type telnet > /dev/null 2>&1
+type telnet >/dev/null 2>&1
 if [ $? -ne 0 ]; then
-  echo "${name}: \"telnet\" not found.";  exit 77
+       echo "${name}: \"telnet\" not found.";
+       exit 77
 fi
 
 # hello world! :-)
 echo "stressing server with $CLIENTS clients (be patient!):"
 
 # read in functions
-. ${srcdir}/functions.inc
+. "${srcdir}/functions.inc"
 
 # create scripts for expect(1)
 no=0
 while [ ${no} -lt $CLIENTS ]; do
-  cat ${srcdir}/stress-A.e > tests/${no}.e
-  echo "send \"nick test${no}\\r\"" >> tests/${no}.e
-  cat ${srcdir}/stress-B.e >> tests/${no}.e
-  no=`expr ${no} + 1`
+       cat "${srcdir}/stress-A.e" >tests/${no}.e
+       echo "send \"nick test${no}\\r\"" >>tests/${no}.e
+       cat "${srcdir}/stress-B.e" >>tests/${no}.e
+       no=`expr ${no} + 1`
 done
 
 # run first script and check if it succeeds
 echo_n "checking stress script ..."
-expect tests/0.e > logs/stress-0.log 2> /dev/null
+expect tests/0.e >logs/stress-0.log 2>/dev/null
 if [ $? -ne 0 ]; then
-  echo " failure!"
-  exit 1
+       echo " failure!"
+       exit 1
 else
-  echo " ok."
+       echo " ok."
 fi
 
 no=0
 while [ ${no} -lt $CLIENTS ]; do
-  expect tests/${no}.e > logs/stress-${no}.log 2> /dev/null &
+       expect tests/${no}.e >logs/stress-${no}.log 2>/dev/null &
 
-  no=`expr ${no} + 1`
-  echo "started client $no/$CLIENTS."
+       no=`expr ${no} + 1`
+       echo "started client $no/$CLIENTS."
 
-  [ $MAX -gt 0 ] && $srcdir/wait-tests.sh $MAX
+       [ $MAX -gt 0 ] && "$srcdir/wait-tests.sh" $MAX
 done
 
 echo_n "waiting for clients to complete: ."
 touch logs/check-idle.log
 while true; do
-  expect ${srcdir}/check-idle.e >> logs/check-idle.log; res=$?
-  echo "====================" >> logs/check-idle.log
-  [ $res -ne 99 ] && break
+       expect "${srcdir}/check-idle.e" >>logs/check-idle.log; res=$?
+       echo "====================" >>logs/check-idle.log
+       [ $res -ne 99 ] && break
 
-  # there are still clients connected. Wait ...
-  sleep 3
-  echo_n "."
+       # there are still clients connected. Wait ...
+       sleep 3
+       echo_n "."
 done
 
 [ $res -eq 0 ] && echo " ok." || echo " failure!"
-
 exit $res
-
-# -eof-
index 68c87d28989059301d2bfec85fa581905216488b..18fe9a55c3d516201993249ca5b9d00303adfd07 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # ngIRCd Test Suite
-# Copyright (c)2002-2004 by Alexander Barton (alex@barton.de)
+# Copyright (c)2001-2024 Alexander Barton (alex@barton.de) and Contributors.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -9,29 +9,26 @@
 # (at your option) any later version.
 # Please read the file COPYING, README and AUTHORS for more information.
 #
-# $Id: test-loop.sh,v 1.2 2004/09/04 19:14:46 alex Exp $
-#
-
-# detect source directory
-[ -z "$srcdir" ] && srcdir=`dirname $0`
 
 # parse command line
-[ "$1" -gt 0 ] 2> /dev/null && LOOPS="$1" || LOOPS=5
-[ "$2" -gt 0 ] 2> /dev/null && WAIT="$2" || WAIT=5
+[ "$1" -gt 0 ] 2>/dev/null && LOOPS="$1" || LOOPS=5
+[ "$2" -gt 0 ] 2>/dev/null && WAIT="$2" || WAIT=5
+
+# detect source directory
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
 
 loop=0
 while [ ${loop} -lt $LOOPS ]; do
-  loop=`expr ${loop} + 1`
-  echo "      loop $loop/$LOOPS starting:"
-  for s in $srcdir/*-test; do
-    sh $s; r=$?
-    [ $r -ne 0 ] && exit $r
-    sleep 1
-  done
-  if [ ${loop} -lt $LOOPS ]; then
-    echo "      waiting $WAIT seconds ..."
-    sleep $WAIT
-  fi
+       loop=`expr ${loop} + 1`
+       echo "      loop $loop/$LOOPS starting:"
+       for s in "$srcdir"/*-test; do
+               sh "$s"; r=$?
+               [ $r -ne 0 ] && exit $r
+               sleep 1
+       done
+       if [ ${loop} -lt $LOOPS ]; then
+               echo "      waiting $WAIT seconds ..."
+               sleep $WAIT
+       fi
 done
-
-# -eof-
index 7af8c593fad57eb78fb7cf6d7900003bba45d571..3e46c18706651a536ed8c202ff95f2ab06132d63 100755 (executable)
 #
 
 # detect source directory
-[ -z "$srcdir" ] && srcdir=`dirname $0`
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
 
-name=`basename $0`
+name=`basename "$0"`
 test=`echo ${name} | cut -d '.' -f 1`
 [ -d logs ] || mkdir logs
 
 if [ ! -r "$test" ]; then
-  echo "$test: test not found" >>tests-skipped.lst
-  echo "${name}: test \"$test\" not found!";  exit 77
-  exit 1
+       echo "$test: test not found" >>tests-skipped.lst
+       echo "${name}: test \"$test\" not found!";  exit 77
+       exit 1
 fi
 
 # read in functions
-. ${srcdir}/functions.inc
+. "${srcdir}/functions.inc"
 
-type expect > /dev/null 2>&1
+type expect >/dev/null 2>&1
 if [ $? -ne 0 ]; then
-  echo "$test: \"expect\" not found" >>tests-skipped.lst
-  echo "${name}: \"expect\" not found.";  exit 77
+       echo "$test: \"expect\" not found" >>tests-skipped.lst
+       echo "${name}: \"expect\" not found."
+       exit 77
 fi
-type telnet > /dev/null 2>&1
+type telnet >/dev/null 2>&1
 if [ $? -ne 0 ]; then
-  echo "$test: \"telnet\" not found" >>tests-skipped.lst
-  echo "${name}: \"telnet\" not found.";  exit 77
+       echo "$test: \"telnet\" not found" >>tests-skipped.lst
+       echo "${name}: \"telnet\" not found."
+       exit 77
 fi
 
 case "$test" in
-  *ssl*)
-    type openssl > /dev/null 2>&1
-    if [ $? -ne 0 ]; then
-      echo "$test: \"openssl\" not found" >>tests-skipped.lst
-      echo "${name}: \"openssl\" not found.";  exit 77
-    fi
-    ;;
+       *ssl*)
+               type openssl >/dev/null 2>&1
+               if [ $? -ne 0 ]; then
+                       echo "$test: \"openssl\" not found" >>tests-skipped.lst
+                       echo "${name}: \"openssl\" not found."
+                       exit 77
+               fi
+               ;;
 esac
 
 # prepare expect script
@@ -58,10 +62,8 @@ if test -t 1 2>/dev/null; then
 fi
 
 echo_n "running ${test} ..."
-expect "$e_exec" > logs/${test}.log; r=$?
+expect "$e_exec" >logs/${test}.log; r=$?
 [ $r -eq 0 ] && echo " ok." || echo " failure!"
 
 rm -f "$e_tmp"
 exit $r
-
-# -eof-
index fb3be1858540f7ded7eaec20263e99256be37f30..b6fa08f5b7d8e5f5e00d89fb57a7ae7837f9e7aa 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # ngIRCd Test Suite
-# Copyright (c)2002-2004 by Alexander Barton (alex@barton.de)
+# Copyright (c)2001-2024 Alexander Barton (alex@barton.de) and Contributors.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -9,39 +9,36 @@
 # (at your option) any later version.
 # Please read the file COPYING, README and AUTHORS for more information.
 #
-# $Id: wait-tests.sh,v 1.5 2005/08/12 21:34:19 alex Exp $
-#
 
-[ "$1" -gt 0 ] 2> /dev/null && MAX="$1" || MAX=5
+[ "$1" -gt 0 ] 2>/dev/null && MAX="$1" || MAX=5
 
 # detect source directory
-[ -z "$srcdir" ] && srcdir=`dirname $0`
+[ -z "$srcdir" ] && srcdir=`dirname "$0"`
+set -u
 
 PS_FLAGS="-f"
 ps $PS_FLAGS >/dev/null 2>&1
 [ $? -ne 0 ] && PS_FLAGS="a"
 
 # read in functions
-. ${srcdir}/functions.inc
+. "${srcdir}/functions.inc"
 
 msg=0
 while true; do
-  count=`ps $PS_FLAGS | grep "expect " | wc -l`
-  count=`expr $count - 1`
+       count=`ps $PS_FLAGS | grep "expect " | wc -l`
+       count=`expr $count - 1`
 
-  [ $count -le $MAX ] && break
+       [ $count -le $MAX ] && break
 
-  if [ $msg -lt 1 ]; then
-    echo_n "      waiting for processes to settle: "
-    msg=1
-  fi
+       if [ $msg -lt 1 ]; then
+               echo_n "      waiting for processes to settle: "
+               msg=1
+       fi
 
-  # there are still clients connected. Wait ...
-  echo_n "$count>$MAX "
-  sleep 1
+       # there are still clients connected. Wait ...
+       echo_n "$count>$MAX "
+       sleep 1
 done
 
 [ $msg -gt 0 ] && echo "done: $count"
 exit 0
-
-# -eof-