2008-05-02 18:36:16 +00:00
|
|
|
#!/usr/bin/awk -f
|
|
|
|
BEGIN {
|
2009-04-08 14:44:16 +00:00
|
|
|
if (ENVIRON["USEOPENSSLFORXCAT"]) {
|
|
|
|
server = "openssl s_client -quiet -connect " ENVIRON["XCATSERVER"]
|
|
|
|
} else {
|
|
|
|
server = "/inet/tcp/0/127.0.0.1/400"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-05-02 18:36:16 +00:00
|
|
|
server = "/inet/tcp/0/127.0.0.1/400"
|
|
|
|
quit = "no"
|
|
|
|
|
|
|
|
|
|
|
|
print "<xcatrequest>" |& server
|
|
|
|
print " <command>getpostscript</command>" |& server
|
|
|
|
print "</xcatrequest>" |& server
|
|
|
|
|
|
|
|
while (server |& getline) {
|
|
|
|
print $0
|
2008-05-07 19:34:12 +00:00
|
|
|
if (match($0,"<serverdone>")) {
|
|
|
|
quit = "yes"
|
|
|
|
}
|
|
|
|
if (match($0,"</xcatresponse>") && match(quit,"yes")) {
|
|
|
|
close(server)
|
|
|
|
exit
|
|
|
|
}
|
2008-05-02 18:36:16 +00:00
|
|
|
}
|
|
|
|
}
|