liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

wait-for-wlan.expect (467B)


      1 set timeout 60
      2 
      3 spawn socat unix-connect:vm/console -
      4 send "\r\n"
      5 expect "login:" {  send "root\r\n" }
      6 expect "#"
      7 set FINISHED 0
      8 set EXIT "1"
      9 send "ls -l /run/uncaught-logs/current\r\n"
     10 expect "#"
     11 while { $FINISHED < 10 } {
     12   send "grep AP-ENABLED /run/uncaught-logs/current || echo not\r\n"
     13   
     14   expect {
     15     "wlan0: AP-ENABLED" { set FINISHED 10; set EXIT 0; }
     16     "not" { send_user "waiting ..." ; sleep 5 }
     17   }
     18   set FINISHED [ expr $FINISHED + 1 ]
     19 }
     20 
     21 exit $EXIT