diff --git a/xCAT/postscripts/startsyncfiles.aix b/xCAT/postscripts/startsyncfiles.aix index d42eaaf78..20f23e2d4 100644 --- a/xCAT/postscripts/startsyncfiles.aix +++ b/xCAT/postscripts/startsyncfiles.aix @@ -31,14 +31,14 @@ print $remote "\n"; my $response=''; my $rsp; -my $rc; +my $rc = 0; while (<$remote>) { $response .= $_; if ($response =~ m/<\/xcatresponse>/) { $rsp = eval { XMLin($response,SuppressEmpty=>undef,ForceArray=>1) }; if ($rsp->{serverdone}) { close $remote; - exit !$rc; + exit $rc; } if ($rsp->{errorcode}) { diff --git a/xCAT/postscripts/startsyncfiles.awk b/xCAT/postscripts/startsyncfiles.awk index f429f3c43..3e28fc10b 100755 --- a/xCAT/postscripts/startsyncfiles.awk +++ b/xCAT/postscripts/startsyncfiles.awk @@ -7,7 +7,7 @@ BEGIN { } quit = "no" - exitcode = 1 + exitcode = 0 print "" |& server print " syncfiles" |& server @@ -17,8 +17,9 @@ BEGIN { if (match($0,"")) { quit = "yes" } - if (match($0,"") || match($0,"")) { - exitcode = 0 + if ((match($0,"") && !match($0,"0")) \ + || (match($0,"") && !match($0,"0")) ) { + exitcode = 1 } if (match($0,"") && match(quit,"yes")) { diff --git a/xCAT/postscripts/syncfiles b/xCAT/postscripts/syncfiles index 580ef0f36..eeda46913 100644 --- a/xCAT/postscripts/syncfiles +++ b/xCAT/postscripts/syncfiles @@ -37,7 +37,7 @@ then returncode=$? fi -if [ $returncode -eq 1 ] +if [ $returncode -eq 0 ] then logger -t xCAT "$0: Perform Syncing File action successfully" else