ok getting there:
#!/bin/bash
set -x
telnet -e x console 7020 << %%
x send break
boot disk
%%
If I do this I see:
bash-2.05# ./installfarm.sh
+ telnet -e x console 7020
Telnet escape character is 'x'.
Trying 192.168.1.44...
Connected to console.testnet.
Escape character is 'x'.
telnet> send break
Connection to console.testnet closed by foreign host.
However this does not make a difference and it appears that nothing happens, ie the machine doesn't boot from disk.
If I do this manually I see:
bash-2.05# telnet -e x console 7020
Telnet escape character is 'x'.
Trying 192.168.1.44...
Connected to console.testnet.
Escape character is 'x'.
telnet> send break
Type 'go' to resume
ok boot disk
etc etc ..
It appears that the 'send break' for some reason causes the bash script to exit straight out?
Main Topics
Browse All Topics





by: tfewsterPosted on 2004-10-23 at 09:45:20ID: 12388788
Fooling a telnet client to accept input from a script (Does not work on all telnet clients!)! e.com/Prog ramming/ Pr ogramming_ Platforms/ Unix_Progr amming/Q_1 0126049.ht ml e.com/Prog ramming/ Pr ogramming_ Platforms/ Unix_Progr amming/Q_2 0371033.ht ml
e.com/Prog ramming/ Pr ogramming_ Platforms/ Unix_Progr amming/Q_1 0241151.ht ml
http://www.experts-exchang
http://www.experts-exchang
Using "expect" (which is reliable and ideal for this sort of task):
http://www.experts-exchang
However, Ctrl-] is usually the interrupt character for the telnet client, to the break won't get sent to the system; Check your man page for `telnet` - The Solaris telnet client allows this escape character to be redefined, e.g.
`telnet -e ^B`