Imported Debian patch 1.0-11
[debian/p10cfgd] / examples / stats / telpp
1 #!/usr/local/bin/expect --
2 # a dumb little 'expect' program to check the heard list on ppfma.ampr.org
3
4 set timeout 15
5
6 puts [timestamp -format %c]             ;# time tag the output
7
8 spawn telnet 44.32.4.2
9 expect "login: " { send "wd0fhg\r" }
10
11 expect "NET/ROM*"  { send "j\r" }       ;# for now we will just look at all
12
13 expect  {                       ;# no easy way to tell that the list is 
14                                 ;# complete so we'll just time out
15         "NET/WRONG*"  {}        ;# looking for we can't find.
16         }
17
18 expect "*"      { send "\r\r"  };# flush the expect buffer
19
20 expect "*"      { send "c ax4 w0lkd-1\r" } :# try to connect on .01
21
22 expect "Connected"      {send "\rb\r" }  ;# just try the connection
23
24 expect "*"      { send "\rb\r" };# flush the expect buffer and signoff
25
26 expect "closed*"                ;# wait for the connection to close
27
28 exec sleep 3
29
30 expect eof
31