[comp.unix.wizards] /etc/remote entries like L.sys

deke@ur-valhalla.UUCP (Dikran Kassabian) (10/31/87)

Although my life becomes more networked daily, I still need trus-
ty  "tip"  for  connection to some remote systems.  My university
uses  a  digital  voice/data  telephone  network,  through  which
asynch  communications can easily reach virtually every phone and
computer on campus.  I'm looking for a way to connect  to  remote
systems (which involves responding to one or two prompts) without
intervention required.

It seems to me that it might be possible using "cm"  or  "pn"  in
some  way, but my guesses aren't correct and I have no samples to
look at.  Ideally, the type of entries I use in  L.sys  for  han-
dling this very same situation in uucp would work.

Can anyone help?

=============================================================================
| Deke Kassabian:                 "I never metacharacter I didn't like"     |
|  URochester  Electrical Engineering       ...!rochester!ur-valhalla!deke  |
=============================================================================

wcw@psuhcx.UUCP (11/07/87)

In article <1087@ur-valhalla.UUCP> deke@ur-valhalla.UUCP (Dikran Kassabian) 
writes:
>asynch  communications can easily reach virtually every phone and
>computer on campus.  I'm looking for a way to connect  to  remote
>systems (which involves responding to one or two prompts) without
>intervention required.
>
>look at.  Ideally, the type of entries I use in  L.sys  for  han-
>dling this very same situation in uucp would work.

C-kermit (available from comp.unix.sources archives, if not elsewhere)
will handle chat-scripts in the general syntax of L.sys files.
Strange as it may seem, this may be exactly what you need for strange
`networks' where you need versatility, if not sophistication.  If you
don't want to use kermit, you can always quit once the connection
has been estabilshed and then start your target program.

Since you asked for some examples, I'm including a shell script that
I use to a nearby VAX/VMS cluster twice a day for new mail.  This is a real
hack, but it's a somewhat creative use of kermit, and for the moment
it's the only means we have.  It could be made much more elegant, but
this is the easy fix.  I hope you find it useful.

#!/bin/sh	This is vmsmail
# script to poll the VMS system for any new mail using C-kermit
# Each user to poll is specified on the command line, which would
# typically be in a crontab file.  Every (UNIX) user has a the vax 
# login sequence in the file .vaxrc in # his/her HOME directory.
# All new mail is kept in a temporary file on the vax called NCL.MAI.
# If there is no new mail, this file doesn't exit and the kermit 
# `get' falls through and the script logs off.

if [ -r /usr/spool/uucp/LCK..tty0 ]
then echo "VAX poll failed...line tty0 locked" | mail root
     exit 0
fi
cd /usr/spool/uucppublic
for USER in $*
do
   /usr/local/kermit << @@@
   take /user/$USER/.vaxrc
   script -- ~r $ delete~sncl.mai;*
   script -- ~r $ mail MAIL> SELECT/NEW MAIL> EXTRACT/ALL~sncl.mai MAIL> DEL/ALL MAIL> exit
   script -- ~r $ kermit 32>--32>--32> server
   get ncl.mai
   bye
@@@
   if [ -s ncl.mai ]
   then 	mail $USER < ncl.mai
		rm -f ncl.mai
   fi
done


A sample .vaxrc file:

set modem-dialer direct
set line /dev/tty0
set baud 9600
script -- ~r T12:--T12: v Switching... ~r~r name:--name: ID word:--word: PASSWORD $--$--$--$

Bill Ward	wcw@psuhcx.bitnet	psuvax1!ncl!wcw.uucp
Disclaimer:	Are you kidding?  I'm a grad student!  If anyone shared
		my opinions, they would already have claimed authorship.