#! /bin/sh
#
# Copyright 1998 - 2001 Double Precision, Inc.  See COPYING for
# distribution information.

prefix="/usr/pkg"
exec_prefix="/usr/pkg"
sysconfdir="/usr/pkg/etc/courier"
localstatedir="/var/courier"
bindir="/usr/pkg/bin"
sbindir="/usr/pkg/sbin"

case `basename $0` in
makesmtpaccess)
	. ${sysconfdir}/esmtpd
	;;
makesmtpaccess-msa)
	. ${sysconfdir}/esmtpd
	. ${sysconfdir}/esmtpd-msa
	;;
*)
	echo "I must be invoked as makesmtpaccess or makesmtpaccess-msa" >&2
	exit 1
	;;
esac

umask 022
${bindir}/makedat \
	-src=${ACCESSFILE} \
	-file=${ACCESSFILE}.dat \
	-tmp=${ACCESSFILE}.tmp -cidr || exit 1

${sbindir}/couriertcpd -pid=$PIDFILE -restart
