X-Git-Url: https://secure.softndesign.org/git/?a=blobdiff_plain;f=master%2Fopt%2Fscript%2Fconfigure_matrix;h=976890bd7396a8b11b66c70f5df820c3cf9b1e5a;hb=f624eefcda5de5f6b08761a45d60c69e3ae51fd1;hp=540c3d104a8a8592c7a5534314dca4f859754d94;hpb=757c2d98b5969ec1b1bebab0cdf552b6c5698ad3;p=debian6500.git diff --git a/master/opt/script/configure_matrix b/master/opt/script/configure_matrix index 540c3d1..976890b 100755 --- a/master/opt/script/configure_matrix +++ b/master/opt/script/configure_matrix @@ -8,6 +8,24 @@ # creation script de configuration de la matrice par ligne de commande # ============================================================================ +# get matrix ip +set ip "" +set fid [open "/etc/hosts" r] +while { [gets $fid line] >= 0 } { + regsub "#.*$" $line {} line + if {[string match "*matrix*" $line]} { + regsub -all "\\." $line " " line + foreach word $line { + if {![regexp "^\[0-9\]+$" $word]} break + set digit [format "%03d" $word] + set ip [concat $ip $digit] + } + break + } +} +close $fid +set matrix [join $ip "."] + spawn /opt/trc6500/tools/matrix_tool set timeout 3 @@ -29,7 +47,7 @@ expect { "taper la commande choisie" { send "10\r" } } -expect "nouvelle adresse" { send "010.133.026.253\r" } +expect "nouvelle adresse" { send "$matrix\r" } expect "taper la commande choisie" { send "12\r" }