1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
#!/usr/local/bin/expect --
# a dumb little 'expect' program to check the status of ppfma.ampr.org
set timeout 5
set addr "44.32.4.2"
set call "N3EUA-8"
set pass ""
set prompt "cos>*"
puts [timestamp -format %c] ;# time tag the output
spawn telnet $addr
expect "login: " { send "$call\r" }
expect "word: " { send "$pass\r" }
expect "NET/ROM*" { send "j ax0\r" } ;# for now we will just look at ax0
expect { ;# no easy way to tell that the list is
;# complete so we'll just time out
"NET/WRONG*" {} ;# looking for we can't find.
}
expect "*" { send "\r@\r" };# flush the expect buffer and go to sysop
expect $prompt { send "uptime\r" }
expect $prompt { send "syncstat\r" }
expect $prompt { send "asystat\r" }
expect $prompt { send "exit\r" }
expect "mode...*" { }
expect "*" { send "\rb\r" };# flush the expect buffer and signoff
expect "closed*" ;# wait for the connection to close
exec sleep 3
expect eof
|