liminix/tests/pppoe/getaddress.expect

21 lines
479 B
Text
Raw Normal View History

2022-09-26 11:47:29 +02:00
set timeout 60
spawn socat unix-connect:vm/console -
2022-09-26 11:47:29 +02:00
send "\r\n"
expect "login:" { send "root\r\n" }
expect "#"
2022-09-26 11:47:29 +02:00
set FINISHED 0
set EXIT "1"
while { $FINISHED < 5 } {
send "ip address show dev ppp0 | grep ppp0\r\n"
expect {
"192.168.100.1" { set FINISHED 10; set EXIT 0; }
"can't find device" { send_user "waiting ..." ; send "\r\n"; sleep 3 }
"DOWN" { send_user "waiting ..." ; send "\r\n"; sleep 2 }
2022-09-26 11:47:29 +02:00
}
set FINISHED [ expr $FINISHED + 1 ]
}
exit $EXIT