X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=simple-cdd%2Fadditional_scripts%2Fset_mediatray.tcl;fp=simple-cdd%2Fadditional_scripts%2Fset_mediatray.tcl;h=0000000000000000000000000000000000000000;hb=7cf8d4b77c1be839986f26cbd946ba28ae6a464e;hp=02f76b210004760274dde35a6a4e360bf47ae5f5;hpb=1a388d7d89aa3e2b3333b71829e02c68003c886b;p=debian6500.git diff --git a/simple-cdd/additional_scripts/set_mediatray.tcl b/simple-cdd/additional_scripts/set_mediatray.tcl deleted file mode 100755 index 02f76b2..0000000 --- a/simple-cdd/additional_scripts/set_mediatray.tcl +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/expect - -# ============================================================================ -# -# Copyright (C) THALES. All rights reserved -# Author: Laurent Mazet -# -# Script de connection au switchs -# -# 2014-10-06 V1.0 : Creation -# -# ============================================================================ - -# default value -set blade {0} -set host "" -set login "admin" -set password "thalescom02" -set prompt "system>" - -proc usage {script_name rc} { - puts "usage: [exec basename $script_name] \[host\] \[-b blade\] \[-h\] \[-l login\] \[-p password\] \[-x prompt\]" - exit $rc -} - -# process argument -set action "" -for {set i 0} {$i < [llength $argv]} {incr i} { - set arg [lindex $argv $i] - switch $arg { - -b { set action "-blade" } - -h { usage $argv0 0 } - -l { set action "-login" } - -p { set action "-password" } - -x { set action "-prompt" } - default { - switch $action { - -blade { set blade $arg } - -login { set login $arg } - -password { set password $arg } - -prompt { set prompt $arg } - default { set host $arg } - } - set action "" - } - } -} -if {$action != ""} { - puts "missing arguments" - exit 1 -} -if { $host == "" } { - usage $argv0 1 -} - -# start connection -spawn telnet $host - -# login -expect { - "username:" { send "$login\r" } - timeout { send_user "connection to host failed\n"; exit 1 } - eof { send_user "connection to host failed\n"; exit 1 } -} - - -# password -expect { - "password:" { send "$password\r" } - timeout { send_user "connection to host failed\n"; exit 1 } - eof { send_user "connection to host failed\n"; exit 1 } -} - -expect { - "$prompt" { send "mt -b $blade\r" } - "username:" { send_user "connection to host failed\n"; exit 1 } -} - -expect { - "OK" { send "exit\r" } - "$prompt" { send_user "error\n"; exit 1 } -} - -send_user "\n" -exit 0 -# vim:set tabstop=4 shiftwidth=4 softtabstop=4: