2009-06-04 15:33:44 +00:00
|
|
|
#!/usr/bin/awk -f
|
|
|
|
BEGIN {
|
2009-09-01 18:39:07 +00:00
|
|
|
if (ENVIRON["USEOPENSSLFORXCAT"]) {
|
2011-04-21 09:49:40 +00:00
|
|
|
server = "openssl s_client -connect " ENVIRON["XCATSERVER"] " 2> /dev/null"
|
2009-09-01 18:39:07 +00:00
|
|
|
} else {
|
|
|
|
server = "/inet/tcp/0/127.0.0.1/400"
|
|
|
|
}
|
2009-06-04 15:33:44 +00:00
|
|
|
|
2009-07-15 13:08:51 +00:00
|
|
|
quit = "no"
|
2011-02-28 07:33:57 +00:00
|
|
|
exitcode = 0
|
2009-06-04 15:33:44 +00:00
|
|
|
|
2009-07-15 13:08:51 +00:00
|
|
|
print "<xcatrequest>" |& server
|
|
|
|
print " <command>syncfiles</command>" |& server
|
|
|
|
print "</xcatrequest>" |& server
|
2009-06-04 15:33:44 +00:00
|
|
|
|
2009-07-15 13:08:51 +00:00
|
|
|
while (server |& getline) {
|
|
|
|
if (match($0,"<serverdone>")) {
|
|
|
|
quit = "yes"
|
|
|
|
}
|
2011-02-28 07:33:57 +00:00
|
|
|
if ((match($0,"<errorcode>") && !match($0,"<errorcode>0")) \
|
|
|
|
|| (match($0,"<error>") && !match($0,"<error>0")) ) {
|
|
|
|
exitcode = 1
|
2009-07-15 13:08:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (match($0,"</xcatresponse>") && match(quit,"yes")) {
|
|
|
|
close(server)
|
|
|
|
exit exitcode
|
|
|
|
}
|
|
|
|
}
|
2009-06-04 15:33:44 +00:00
|
|
|
}
|