-
Notifications
You must be signed in to change notification settings - Fork 136
Template Examples
knipknap edited this page Feb 16, 2011
·
3 revisions
{
connection.autoinit()
connection.set_prompt(/(?:\]|#)/)
}
copy tftp $destination
1.2.3.4
/path/to/tftp/$file
{connection.set_timeout(60 * 30)}
$file{
extract /^%(Warning)/ as warning
extract /(0x\w+)/ as checksum
if warning is "Warning"
sys.message("Confirming Warning.")
enter
extract /(0x\w+)/ as checksum
end
connection.set_prompt()
connection.set_timeout(30)
}
show $destination
verify /md5 $destination$file
Start the script using:
exscript -d file=my_ios_filename.bin -d destination=slot0: my_script.exscript router1
my_script.exscript:
configure exclusive
{loop interface, description as int, descr}
set interface $int description "$descr"
{end}
commit and-quit
my_host_file:
address interface description
host1 so-1/0/0 this_is_my_first_description
host2 so-5/1/0 this_is_my_second_description
host3 so-2/0/0 this_is_my_third_description
(Note that the columns need to be separated by tabs.)
Start the script using:
exscript --csv-hosts my_host_file my_script.exscript