#!/bin/sh
#
# $Id: runmail.sh,v 4.4 1998/04/07 12:22:00 mj Exp $
#
# Toss gateway output mail
#
# Usage: runmail
#

LOCK=runmail

# Output to "log-out" log file
FIDOGATE_LOGFILE="%G/log-mail"
export FIDOGATE_LOGFILE

# Lock it
/usr/pkg/lib/fidogate/ftnlock -l $LOCK $$
st=$?
if [ $st -ne 0 ]; then
	exit 2
fi

/usr/pkg/lib/fidogate/bin/runtoss outpkt/mail

# Unlock it
/usr/pkg/lib/fidogate/ftnlock -u $LOCK

exit 0
