#!/bin/sh
# $Id: t-install.sh,v 1.11 2006/10/05 23:46:10 ca Exp $
#
# Copyright (c) 2004, 2005 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.
#
# -------------------------------------------------------
# Simple script to setup a dummy installation environment
# this can(?) be used to test sm.setup.sh
# run this in ${OBJ}/misc/
# -------------------------------------------------------
# source directory of this (and other) shell script
SD=`dirname $0`
if test "${SD}" = "."
then
SD=../misc
fi
HERE=`pwd`
ERRS=0
# sendmail X queue directory
MTAQDIR=${HERE}/smx
export MTAQDIR
# fake it... can't perform chown unless root but we don't want that here
MTACHOWN=echo
export MTACHOWN
# go to right directory
cd ..
make install
# alternatively: try only installation script
# ${SHELL} ${HERE}/sm.setup.sh
# check some results
# main directory
if test ! -d ${MTAQDIR}
then
echo "$0: missing ${MTAQDIR}"
exit 1
fi
cd ${MTAQDIR} || exit 1
# check queue directories
for i in 0 1 2 3 4 5 6 7 8 9 A B C D E F
do
if test -d ${i}
then
:
else
echo "$0: missing queue dir ${i}"
ERRS=`expr ${ERRS} + 1 `
test X"${MTA_STOPONERROR}" != X && exit 1
fi
done
MTACONF=smx.conf
if test -s ${MTACONF}
then
${HERE}/smconf ${MTACONF} || exit 1
else
echo "$0: missing ${MTACONF}"
ERRS=`expr ${ERRS} + 1 `
test X"${MTA_STOPONERROR}" != X && exit 1
fi
test -s mt || exit 1
test -s mcp.sh || exit 1
test -s lognull.sh || exit 1
# check existence of logfiles
for i in smtps smtpc qmgr smar
do
test -f ${i}.log || exit 2
done
# ----------------
if test "${ERRS}" = "0"
then
exit 0
else
echo "${ERRS} error(s)"
exit 1
fi
syntax highlighted by Code2HTML, v. 0.9.1