3 7ec11de5 2004-09-04 alex # ngIRCd Test Suite
4 7ec11de5 2004-09-04 alex # Copyright (c)2002-2004 by Alexander Barton (alex@barton.de)
6 7ec11de5 2004-09-04 alex # This program is free software; you can redistribute it and/or modify
7 7ec11de5 2004-09-04 alex # it under the terms of the GNU General Public License as published by
8 7ec11de5 2004-09-04 alex # the Free Software Foundation; either version 2 of the License, or
9 7ec11de5 2004-09-04 alex # (at your option) any later version.
10 7ec11de5 2004-09-04 alex # Please read the file COPYING, README and AUTHORS for more information.
12 f2ba8abe 2005-08-12 alex # $Id: wait-tests.sh,v 1.5 2005/08/12 21:34:19 alex Exp $
15 7ec11de5 2004-09-04 alex [ "$1" -gt 0 ] 2> /dev/null && MAX="$1" || MAX=5
17 f2ba8abe 2005-08-12 alex # detect source directory
18 f2ba8abe 2005-08-12 alex [ -z "$srcdir" ] && srcdir=`dirname $0`
20 f7a4d03b 2004-09-04 alex PS_FLAGS="-f"
21 f7a4d03b 2004-09-04 alex ps $PS_FLAGS >/dev/null 2>&1
22 f7a4d03b 2004-09-04 alex [ $? -ne 0 ] && PS_FLAGS="a"
24 450251f0 2004-09-06 alex # read in functions
25 450251f0 2004-09-06 alex . ${srcdir}/functions.inc
28 7ec11de5 2004-09-04 alex while true; do
29 f7a4d03b 2004-09-04 alex count=`ps $PS_FLAGS | grep "expect " | wc -l`
30 7ec11de5 2004-09-04 alex count=`expr $count - 1`
32 7ec11de5 2004-09-04 alex [ $count -le $MAX ] && break
34 7ec11de5 2004-09-04 alex if [ $msg -lt 1 ]; then
35 450251f0 2004-09-06 alex echo_n " waiting for processes to settle: "
39 7ec11de5 2004-09-04 alex # there are still clients connected. Wait ...
40 450251f0 2004-09-06 alex echo_n "$count>$MAX "
44 7ec11de5 2004-09-04 alex [ $msg -gt 0 ] && echo "done: $count"