diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 7f07f9f72..20a771fbe 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -1346,16 +1346,16 @@ sub addkit } else { $rc = system("cp -rf $kitdir/other_files/$_ $installdir/postscripts/"); } + if($rc && !-e "$installdir/postscripts/$_"){ + my %rsp; + push@{ $rsp{data} }, "Failed to copy scripts from $kitdir/scripts/ to $installdir/postscripts"; + xCAT::MsgUtils->message( "E", \%rsp, $callback ); + return 1; + } + $rc = 0; chmod(0755,"$installdir/postscripts/$_"); } - if($rc){ - my %rsp; - push@{ $rsp{data} }, "Failed to copy scripts from $kitdir/scripts/ to $installdir/postscripts"; - xCAT::MsgUtils->message( "E", \%rsp, $callback ); - return 1; - } - # Copying plugins to /opt/xcat/lib/perl/xCAT_plugin/ if ( -d "$kitdir/plugins/" ) {