Data una lista di IP si collega ad ogni switch in telnet e lancia il comando di backup in modo da salvare sul tftp server un file con IP.cfg
questo è il comando che viene lanciato è adatto agli switch Hp Procurve
copy startup-config tftp 10.0.82.22 10.0.64.133.cfg
copy startup-config tftp 10.0.82.22 10.0.64.134.cfg
#!/usr/bin/expect set iptftp "10.0.82.22" set ip "10.0.64.133" set login "administrator" set password "xxxxxxxxxx" set hostlist [open "/home/leonardo/Backup-TFTP-Switch/ip-switch.txt" "r"] set ip [read -nonewline $hostlist] foreach line [split $ip \n] {