Administrator Guide
send "get $post_conf\n"
expect "ftp>"
send "get $config_file\n"
expect "ftp>"
send "bye\n"
expect eof
after 5000
puts "Download Complete !!!\r\n"
if {[file exists $config_file]} {
puts "Config File: $config_file downloaded successfully\r\n"
} else {
puts "ERROR: Config File: $config_file - Not Found\r\n"
}
if {[file exists $post_conf]} {
puts "Post Config Script: $post_conf downloaded
successfully\r\n"
} else {
puts "ERROR: Post Config Script: $post_conf - Not
Found\r\n"}
# Copy Config to Startup Config
print_f10do "show version"
after 5000
print_f10do "copy flash://$config_file startup-config"
print_f10do "yes"
after 5000
puts "Pre-Config Script Execution Successful !!!!!\r\n"
exit 0
Post-configuration Script – BMP Mode
The following example shows the post-configuration script for the S4810 or S4820T platform:
#! /usr/bin/expect
#/DELL-NETWORKING
# Post Config Script for S4810-10
# Execute F10do and Print
proc print_f10do {cmd_str} {
set str [exec f10do "$cmd_str"]
set tmp_str [string map {\n \r\n} $str ]
puts $tmp_str
}
# Interfaces Configurations
set interface_list_slot [list "0/1" "0/5" "0/9"]
set interface_list [list "Te 0/1" "Te 0/5" "Te 0/9"]
set {remote_intf(Te 0/1)} "TenGigabitEthernet 0/1"
set {remote_intf(Te 0/5)} "TenGigabitEthernet 0/5"
set {remote_intf(Te 0/9)} "TenGigabitEthernet 0/9"
set hostname "S4810-10"
set max_min 10
set status_file "s4810-10-current-status.dat"
set ftp_ip "20.0.0.1"
puts [exec rstimer 30]
puts "\r\nReset Timer Complete\r\n"
# Open Staus File
set fp [open $status_file w]
puts $fp "========================================\r\n"
puts $fp " Status: $hostname\r\n"
puts $fp "========================================\r\n"
# Configure LLDP Protocol
puts "Configuring LLDP Protocol\r\n"
print_f10do "configure terminal"
print_f10do "protocol lldp"
print_f10do "no disable"
34
Bare Metal Provisioning