#!/bin/sh
# @(#) telephone 1.2 Delta: 95/09/15 15:47:20 Extraction: 95/10/06 11:44:39 @(#)
#
# telephone
#
# author: l. loebel carpenter, computing division, fermilab
#
# history:
# 03aug95	lll	Initial.  Merely a wrapper to pass commands to
#			the VMS system telephone.fnal.gov hosting the
#			actual One True Telephone command.
#
#

# parameters which are needed in the program and may need to be
# set later:

server="telephone.fnal.gov"		# an alias in the name server
user="tele_server"			# a blind account for serving telephone information
if [ `funame -s` = "HP-UX" ]
then
	RSH=remsh

else
	RSH=rsh
fi


#
# first get the [unix-style] command line, complete with " -" instead of 
# the vms style "/" character.  convert.
# NOTE that we require a space before the options (unlike VMS), because
# we do NOT want to convert the "-" character that might appear inside
# of a name!  (We assume that names don't ever contain " -"...)  We need to
# manually add a leading " " so that if the first character of the ${*} is
# a minus, it also gets converted.
#

cmdvals=`echo " ${*}" | sed 's% -% \/%g'`
#
# now rsh over to the server node and let it handle the 
# actual telephone command.
#

${RSH} ${server} -l ${user} "telephone ${cmdvals}"
exit 0
