Added scripts from lgcore
[debian6500.git] / simple-cdd / additional_scripts / configure_matrix.tcl
CommitLineData
b3f3562f
OL
1#!/usr/bin/expect
2
3# ============================================================================
4#
5# Copyright (C) THALES. All rights reserved
6#
7# * V1.0 Laurent Mazet 29/04/2013
8# creation script de configuration de la matrice par ligne de commande
9# ============================================================================
10
11set ipmaxtrix "10.133.28.253"
12
13spawn /opt/trc6500/tools/matrix_tool
14
15set timeout 3
16
17exec ifconfig eth1:0 192.168.1.1 netmask 255.255.255.0
18
19proc cleanexit {rc} {
20 exec ifconfig eth1:0 down
21 exit $rc
22}
23
24expect {
25 "taper la commande choisie" { send "0\r" }
26 timeout { send_user "connection to $host timed out\n"; cleanexit 1 }
27 eof { send_user "connection to host failed\n"; cleanexit 1 }
28}
29expect {
30 "timeout detected" { send_user "can't connect on defaut ip\n"; cleanexit 1 }
31 "taper la commande choisie" { send "10\r" }
32}
33
34expect "nouvelle adresse" { send "010.133.028.253\r" }
35
36expect "taper la commande choisie" { send "12\r" }
37
38expect "taper la commande choisie" { send "14\r" }
39
40cleanexit 0
41# vim:set tabstop=4 expandtab shiftwidth=4: