#!/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.
# 
# Usage: $0 hostname
# $Id: call-remote-computer,v 1.3 1993/08/02 07:17:19 treed Exp $
# $Author: treed $

# Call remote host.

CIN=1

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

if test $# -lt 1 ; then
  exit ${NO}
fi

if test ! -z "$1" ; then
  REMOTE=$1
  shift
else
  echo "${PROMPT} Could not determine \$1" >&2
  exit ${NO}
fi

if test ! -z "$1" ; then
  DEBUG=$1
  shift
else
  DEBUG=99
fi

/usr/lib/uucp/uucico -r1 -x${DEBUG} -s${REMOTE} 2>/etc/connect/uupollResults
STATUS=$?

if test "${STATUS}" != 0  ; then
  echo "${PROMPT} Problem calling ${REMOTE}" >&2
  exit ${STATUS}
else
  exit 0
fi
