#!/bin/sh
#
# $Id: fido_run,v 1.3 1997/06/08 10:25:23 mj Exp $
#
# Run protected and normal inbound tossing (rununpack, runtoss)
#
# Usage: runin
#

PRG=/usr/local/lib/fidogate
LIB=/usr/local/lib/fidogate

#
# Output to "log-in" log file
#
LOGFILE="/var/log/fido/log-in"
export LOGFILE

#
# Lock it
#
$PRG/ftnlock -l runin
st=$?
if [ $st -ne 0 ]; then
	exit 2
fi

$PRG/unpack pin

$PRG/runtoss pin

$PRG/ftnlock -u runin

LOGFILE="/var/log/fido/log-out"
export LOGFILE

#
# Lock it
#
$PRG/ftnlock -l runout
st=$?
if [ $st -ne 0 ]; then
	exit 2
fi

$PRG/ftn2rfc -x $PRG/ftninpost -l

$PRG/runtoss out

#
# Unlock it
#
$PRG/ftnlock -u runout

# $PRG/ftnlock -l expire
# st=$?
# if [ $st -ne 0 ]; then
# 	exit 2
# fi

# $PRG/ftnexpire

# $PRG/ftnlock -u expire

exit 0
