Minicom and scripting

Martin T m4rtntns at gmail.com
Thu Sep 29 21:37:06 UTC 2011


Adam,
closest to the script I'm looking for was this(waits 2s after each
command sent):

<<<<<
root at IBM:~# cat script
print "Starting Cisco 3550 configuration: "
send ""
expect {
"WS-C3550-24-Rix>"
}
send "enable"
expect {
"WS-C3550-24-Rix#"
}
sleep 2
send "conf t"
expect {
"WS-C3550-24-Rix(config)#"
}
sleep 2
send "enable secret 0 passwd"
expect {
"WS-C3550-24-Rix(config)#"
}
sleep 2
send "end"
expect {
"WS-C3550-24-Rix#"
}
sleep 2
send "exit"

timeout 10
exit
root at IBM:~#
>>>>>

However, it has one problem- I wasn't able to exit from runscript. As
one can see, there is an "exit" command at the end of the script +
"timeout 10", but I still had to hit "Ctrl+C" each time. What did I do
wrong?

However, as you told, there seems to be no way to read commands in
from a configuration file line by line using the runscript..


regards,
martin


2011/9/29 Martin T <m4rtntns at gmail.com>:
> Adam,
> I played a little with runscript, but couldn't achive what I wanted.
> On the other hand, I'm a total beginner with runscript as well..
> However, what are the other options to make a script, which reads
> commands from a file one line after another, logs into a network
> device over a console connection(RS-232) each time and executes those
> commands wile sleeping 1s after each line? Is C-Kermit up to this
> task?
>
>
> regards,
> martin
>
>
> 2011/9/28 Adam Lackorzynski <adam at os.inf.tu-dresden.de>:
>>
>> On Mon Sep 26, 2011 at 02:26:28 +0300, Martin T wrote:
>>> Hello,
>>> is it possible to make a script, which reads commands from a file one
>>> line after another, logs into a network device over a console
>>> connection(RS-232) and executes those commands wile sleeping 1s after
>>> each line? My ideal solution would be some sort of utility/script,
>>> which is able to start console session, read a line from file and tell
>>> this over console session and log out. Then wait two seconds, log in,
>>> read in second line, log out etc. Is this doable using Minicom?
>>
>> There's the script facility but I think your requirements go beyond that
>> what it offers, esp. wrt reading in a file.
>>
>>
>> Adam
>> --
>> Adam                 adam at os.inf.tu-dresden.de
>>  Lackorzynski         http://os.inf.tu-dresden.de/~adam/
>>
>> --
>> minicom-devel mailing list <minicom-devel at lists.alioth.debian.org>
>> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/minicom-devel
>>
>



More information about the minicom-devel mailing list