X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=master%2Fopt%2Fscript%2Fconfigure_switch.tcl;fp=master%2Fopt%2Fscript%2Fconfigure_switch.tcl;h=0000000000000000000000000000000000000000;hb=757c2d98b5969ec1b1bebab0cdf552b6c5698ad3;hp=4d34d434d431979317c3891e33d21a11334acacf;hpb=2cb6a627e61a5bf8f1eec7e68f0e34d48672a083;p=debian6500.git diff --git a/master/opt/script/configure_switch.tcl b/master/opt/script/configure_switch.tcl deleted file mode 100755 index 4d34d43..0000000 --- a/master/opt/script/configure_switch.tcl +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/expect - -# ============================================================================ -# -# Copyright (C) THALES. All rights reserved -# Author: Laurent Mazet -# -# Script de configuration du switchs -# -# 2013-10-10 V1.0 : Creation -# -# ============================================================================ - -set host [lrange $argv 0 0] -if { $host == "" } { - puts "usage: configure_switch.tcl \[sw1|sw2|swg1|swg2|swm\]" - exit 1 -} - -set tftpserver "" -if { $host == "swg1" } { set tftpserver "10.133.26.160" } -if { $host == "swg2" } { set tftpserver "10.133.26.160" } -if { $host == "swm" } { set tftpserver "10.133.28.160" } -if { $host == "sw1" } { set tftpserver "10.133.26.160" } -if { $host == "sw2" } { set tftpserver "10.133.26.160" } -if { $tftpserver == "" } { puts "unknown switch '$host'"; exit } - -set date [ exec date +%Y%m%d-%H:%m:%S ] -set backup "$host-$date.txt" - -spawn telnet $host - -set timeout 30 - -expect { - "Password:" { send "thales\r" } - incorrect { send_user "invalid password or account\n"; exit 1 } - timeout { send_user "connection to $host timed out\n"; exit 1 } - eof { send_user "connection to host failed\n"; exit 1 } -} -expect -exact ">" { send "enable\r" } -expect "Password:" { send "thales\r" } -expect "#" { send "copy running-config tftp://$tftpserver/$backup\r" } -expect -exact "?" { send "$tftpserver\r" } -expect -exact "?" { send "$backup\r" } -expect "#" { send "copy tftp://$tftpserver/$host.txt startup-config\r" } -expect -exact "?" { send "startup-config\r" } -#expect "#" { send_user " << reload or exit ? >> "; interact } -expect "#" { send "reload\r" } - -exit 0 -# vim:set tabstop=4 expandtab shiftwidth=4: