[ale] Using Telnet under script control

Clarke Bishop clarke at learn.net
Mon Apr 29 10:51:56 EDT 1996


I have a Pipeline-50 ISDN router connected to my Linux firewall. The =
Pipeline-50 provides Telnet  support so you can get a screen full of =
status information and configure the router.

What I want to do is write a shell script that can monitor and log the =
status of the the router. Here's what I have tried so far to retrieve =
the status screen:

1. Telnet P50 > output.screen < stop.cmd
This almost works. The problem is that the quit commands in stop.cmd get =
executed
before the router outputs the status screen. All I get is the Telnet =
startup info.
=20
2. Same as above, but put lots of characters in stop.cmd to slow it =
down.=20
Either this doesn't work either or I still haven't put enough characters =
in stop.cmd.
Again, all I get is the Telnet startup info.
=20
3. Telnet P50 > output.screen &
The idea here is to run Telnet in the background, get my output.screen, =
and kill Telnet later.
Unfortunately, I still only get the Telnet startup info.

If I issue the Telnet P50 > output.screen manually and then quit Telnet =
manually, the process works fine, and I get the data I want. Any ideas =
???

TIA,
    Clarke






More information about the Ale mailing list