#! /bin/sh
#
# Copyright 1998 - 2001 S. Varshavchik.  See COPYING for
# distribution information.

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

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
