#!/bin/sh
# Copyright (c) 1992, 1993 Black Market Technologies, Inc.
# This is proprietary software.  You must purchase a license for each computer
# on which you want to use this software.  For complete licensing information, 
# check the license agreement that came with this software or contact
# Black Market Technologies at +1 718 522-5090.
# 
# $0 remotehostname
# $Id: is-remote-poll,v 1.5 1993/08/23 00:32:02 treed Exp $
# $Author: treed $ $Date: 1993/08/23 00:32:02 $

CIN=23

PROMPT="Connect It: ${CIN}: "
APP_PATH=$1
shift
PATH="${APP_PATH}/Scripts:${APP_PATH}:/etc:/usr/etc:/usr/ucb:/bin:/usr/bin"
export PATH

YES=0
NO=1
PROBLEM=9

CONNECT_RC=/etc/rc.connect
LOCAL_RC=/etc/rc.local
UUPOLL=/usr/bin/uupoll

if test $# != 1 ; then
#   echo "${PROMPT} Not enough arguments">&2
  exit ${PROBLEM}
fi

if test ! -f ${CONNECT_RC} ; then
#   echo "${PROMPT} Could not locate ${CONNECT_RC}" >&2
  exit ${PROBLEM}
fi

ENTRY="`egrep \"uupoll[ 	]$1\" ${CONNECT_RC} | head -1 | awk '{print $2}'`"

if test "${ENTRY}" = $1 ; then
#   echo "${PROMPT} Found uupoll entry for $1" >&2
  exit ${YES}
else
  exit ${NO}
fi
