2008-04-16 21:08:57 +00:00
|
|
|
#!/usr/bin/awk -f
|
|
|
|
BEGIN {
|
2012-01-06 13:15:09 +00:00
|
|
|
if ((ENVIRON["USEOPENSSLFORXCAT"]) || (ENVIRON["AIX"])) {
|
2015-02-13 01:19:00 +00:00
|
|
|
server = "openssl s_client -quiet -no_ssl3 -no_ssl2 -connect " ENVIRON["XCATSERVER"] " -rand /bin/nice 2> /dev/null"
|
2009-09-01 18:39:07 +00:00
|
|
|
} else {
|
|
|
|
server = "/inet/tcp/0/127.0.0.1/400"
|
|
|
|
}
|
2008-04-16 21:08:57 +00:00
|
|
|
quit = "no"
|
|
|
|
|
|
|
|
|
|
|
|
print "<xcatrequest>" |& server
|
|
|
|
print " <command>getcredentials</command>" |& server
|
|
|
|
print " <callback_port>300</callback_port>" |& server
|
2009-03-15 20:23:48 +00:00
|
|
|
for (i=1; i<ARGC; i++)
|
|
|
|
print " <arg>"ARGV[i]"</arg>" |& server
|
2008-04-16 21:08:57 +00:00
|
|
|
print "</xcatrequest>" |& server
|
|
|
|
|
|
|
|
while (server |& getline) {
|
2011-04-27 11:35:34 +00:00
|
|
|
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-04-16 21:08:57 +00:00
|
|
|
}
|
|
|
|
}
|