+ end
+
+fun checkIt cmd {node, uname} =
+ OS.Process.isSuccess (OS.Process.system
+ ("DOMTOOL_USER=hcoop /usr/local/bin/domtool-admin "
+ ^ cmd ^ " " ^ Init.nodeName node ^ " " ^ uname ^ " >/dev/null 2>/dev/null"))
+
+val isTpe = checkIt "tpe"
+val cronAllowed = checkIt "cron"
+val ftpAllowed = checkIt "ftp"
+
+fun findFirewallRules {node, uname} =
+ let
+ val proc = Unix.execute ("/bin/sh",
+ ["-c",
+ "DOMTOOL_USER=hcoop /usr/local/bin/domtool-admin firewall "
+ ^ Init.nodeName node ^ " " ^ uname])
+
+ val inf = Unix.textInstreamOf proc
+
+ fun readEm lines =
+ case TextIO.inputLine inf of
+ SOME line => readEm (String.substring (line, 0, size line - 1) :: lines)
+ | NONE => rev lines
+
+ val lines = readEm []
+ in
+ TextIO.closeIn inf;
+ if OS.Process.isSuccess (Unix.reap proc) then
+ lines