0

I am connecting to Junos OS on Juniper EX-2200 switches using minicom as shown below

minicom -C log_sw1 sw1

Now I have a series of commands that I need to execute on sw1.(example shown below)

cli
request system zeroize
show config
show interface
edit 
delete protocols
set system arp aging-timer 240

I want to avoid having to type these commands every time I log into the system.I want to put them in a config file and I want the it to be execute every time I log into the switch using minicom.

Is there any way I can achieve this?

quanta
  • 50,327
  • 19
  • 152
  • 213
liv2hak
  • 303
  • 4
  • 13
  • 25

1 Answers1

1

runscript is what you're looking for.

print "Starting Juniper EX-2200 switch configuration: "
send ""
expect {
    "EX-2200>"
}
send "cli"
expect {
    "..."
}
...

Give it a try.

quanta
  • 50,327
  • 19
  • 152
  • 213