Make wait-kdc.sh able to wait on other things.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21839 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-08-08 06:48:57 +00:00
parent f2df45620f
commit 206d05900a

View File

@@ -34,26 +34,27 @@
# $Id$ # $Id$
# #
log=${1:-messages.log} name=${1:-KDC}
log=${2:-messages.log}
t=0 t=0
waitsec=20 waitsec=20
echo "Waiting for KDC to start, looking logfile ${log}" echo "Waiting for ${name} to start, looking logfile ${log}"
while true ; do while true ; do
t=`expr ${t} + 2` t=`expr ${t} + 2`
sleep 2 sleep 2
echo "Have waited $t seconds" echo "Have waited $t seconds"
if tail -3 ${log} | grep 'KDC started' > /dev/null; then if tail -3 ${log} | grep "${name} started" > /dev/null; then
break break
fi fi
if tail -3 ${log} | grep "No sockets" ; then if tail -3 ${log} | grep "No sockets" ; then
echo "The KDC failed to bind to any sockets, another KDC running ?" echo "The ${name} failed to bind to any sockets, another ${name} running ?"
exit 1 exit 1
fi fi
if [ "$t" -gt $waitsec ]; then if [ "$t" -gt $waitsec ]; then
echo "Waited for $waitsec for the KDC to start, and it didnt happen" echo "Waited for $waitsec for the ${name} to start, and it didnt happen"
exit 2 exit 2
fi fi
done done