-
Notifications
You must be signed in to change notification settings - Fork 3
/
Config_tftp_DL.tcl
51 lines (36 loc) · 1.15 KB
/
Config_tftp_DL.tcl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
::cisco::eem::event_register_timer cron cron_entry "*/2 * * * *"
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
if [catch {cli_open} result] {
error $result $errorInfo
} else {
array set cli1 $result
}
if [catch {cli_exec $cli1(fd) "enable"} _cli_result] {
error $_cli_result $errorInfo
}
if [catch {cli_write $cli1(fd) "copy tftp: run"} _cli_result] {
error $_cli_result $errorInfo
}
if [catch {cli_read_pattern $cli1(fd) "Address"} _cli_result] {
error $_cli_result $errorInfo
}
if [catch {cli_write $cli1(fd) "10.0.0.10"} _cli_result] {
error $_cli_result $errorInfo
}
if [catch {cli_read_pattern $cli1(fd) "Source"} _cli_result] {
error $_cli_result $errorInfo
}
if [catch {cli_write $cli1(fd) "5692"} _cli_result] {
error $_cli_result $errorInfo
}
if [catch {cli_read_pattern $cli1(fd) "Destination"} _cli_result] {
error $_cli_result $errorInfo
}
if [catch {cli_exec $cli1(fd) "\n"} _cli_result] {
error $_cli_result $errorInfo
}
# Close open cli before exit.
if [catch {cli_close $cli1(fd) $cli1(tty_id)} result] {
error $result $errorInfo
}