Telnet script



Hi Managers,

I need to telnet to an UNIX server with telnet and run a script
application on it, The idea is to have a script that launch scriptAppl.sh
without letting end users put the username and password for connecting
the UNIX server.
I do the following script con.sh:

###########################
#!/bin/sh
host=@IP
port=23
cmd="scriptAppl.sh"

( echo open ${host} ${port}
sleep 1
echo "user"
echo -e "\r"
sleep 1
echo "passwd"
echo -e "\r"
sleep 1
echo ${cmd}
sleep 1
echo -e "\r"
sleep 1
) | telnet
###########################
My problem is that the connection will hang up from the server after a
while

The use of telnet isn't a problem (security issues)

why the connection hang up ? how can my script stay connected ?

Kind regards,
Kamal
_______________________________________________
sunmanagers mailing list
sunmanagers@xxxxxxxxxxxxxxx
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



Relevant Pages

  • Really weird expect problem
    ... I'm working on a legacy expect script. ... At first glance it would seem that the shell is in echo or verbose mode, ... is operating telnet from a Windows 2000 machine. ... I've looked for strange environment variables. ...
    (comp.unix.programmer)
  • Telnet from within a script strange problem
    ... I tried to send it to a debian server ... When try the same from a commandline, not a script, it works fine. ... echo "HELO mydomain.com" ...
    (alt.os.linux.redhat)
  • Want to understand why this doesnt work right, please
    ... I cobbled together a very basic script to run a program, sleep, run ... The program does launch and run as desired. ... in the Echo to tell me when the script is completed. ...
    (microsoft.public.scripting.vbscript)
  • Re: [SLE] How to spawn another shell script in separate process
    ... I would advise to look into your ip-up.local.doit script, ... Parent processes usually ... echo in a.sh before calling b.sh ... echo running sleep... ...
    (SuSE)
  • Re: Bash: how to make some conditions
    ... Then I have made a #!/bin/sh script that works on with these files. ... it should sleep(?) some time and try again. ... echo NO ... in a directory where the pictures are. ...
    (alt.os.linux.suse)