#!/bin/sh
#
# $Id: runin.sh,v 4.5 1998/11/08 18:28:02 mj Exp $
#
# Toss inbound, protected inbound, uuencode inbound, ftp inbound
#
# Usage: runin
#

LOCK=runin

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

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

if [ -d /var/spool/bt/in ]; then
    /usr/pkg/lib/fidogate/bin/rununpack in
    /usr/pkg/lib/fidogate/bin/runtoss   in
fi

if [ -d /var/spool/bt/pin ]; then
    /usr/pkg/lib/fidogate/bin/rununpack pin
    /usr/pkg/lib/fidogate/bin/runtoss   pin
fi

if [ -d /var/spool/bt/uuin ]; then
    /usr/pkg/lib/fidogate/bin/rununpack uuin
    /usr/pkg/lib/fidogate/bin/runtoss   uuin
fi

if [ -d /var/spool/bt/ftpin ]; then
    /usr/pkg/lib/fidogate/bin/rununpack ftpin
    /usr/pkg/lib/fidogate/bin/runtoss   ftpin
fi

# Process tic files
/usr/pkg/lib/fidogate/ftntick

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

exit 0
