--- /dev/null
+#!/usr/bin/python
+
+from LATClient import LATClient
+from select import select
+import sys
+
+def check_door_service(service, test_string="got wombles?"):
+ latclient = LATClient(service=sys.argv[1])
+ latclient.sock.send(test_string)
+ rfh, wfh = latclient.get_fh()
+ wfh.write(test_string)
+ wfh.flush()
+ rr, wr, er = select([rfh], [], [], 10.0)
+ if rfh not in rr: return "open"
+ recv = rfh.read(len(test_string))
+ if recv <> test_string: return "error"
+ return "closed"
+
+if __name__ == '__main__':
+ result_codes = { 'open' : 0, 'closed' : 1, 'error' : 2 }
+ result = check_door_service(sys.argv[1])
+ print result
+ sys.exit(result_codes[result])