prepare a 1.1 upstream release
[debian/p10cfgd] / examples / stats / ppstats
diff --git a/examples/stats/ppstats b/examples/stats/ppstats
new file mode 100644 (file)
index 0000000..7e907e2
--- /dev/null
@@ -0,0 +1,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
+