#!/bin/sh
# $Id: qmgr-running.sh,v 1.4 2004/12/29 23:47:30 ca Exp $
# Copyright (c) 2003, 2004 Sendmail, Inc. and its suppliers.
#	All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#

# How to check that the QMGR is running?
# wait a bit for startup such that the sockets are created

if test X"${SMTPCSOCK}" = "X"
then
  SMTPCSOCK="qmsmtpc/qmsmtpc"
fi

if test $# -ge 1
then
  SMTPCSOCK="$1"
fi

CNT=0
while test ! -r "${SMTPCSOCK}"
do
  sleep 1
  CNT=`expr ${CNT} + 1 `
  if test ${CNT} -ge 10
  then
    echo "ERROR starting qmgr, ${SMTPCSOCK} does not exist"
    exit 1
  fi
done


syntax highlighted by Code2HTML, v. 0.9.1