|
|
@ -1,5 +1,6 @@
|
|
|
|
package com.xxl.job.core.util;
|
|
|
|
package com.xxl.job.core.util;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.xxl.job.core.log.XxlJobLogger;
|
|
|
|
import org.apache.commons.exec.CommandLine;
|
|
|
|
import org.apache.commons.exec.CommandLine;
|
|
|
|
import org.apache.commons.exec.DefaultExecutor;
|
|
|
|
import org.apache.commons.exec.DefaultExecutor;
|
|
|
|
import org.apache.commons.exec.PumpStreamHandler;
|
|
|
|
import org.apache.commons.exec.PumpStreamHandler;
|
|
|
@ -75,6 +76,9 @@ public class ScriptUtil {
|
|
|
|
exec.setStreamHandler(streamHandler);
|
|
|
|
exec.setStreamHandler(streamHandler);
|
|
|
|
int exitValue = exec.execute(commandline); // exit code: 0=success, 1=error
|
|
|
|
int exitValue = exec.execute(commandline); // exit code: 0=success, 1=error
|
|
|
|
return exitValue;
|
|
|
|
return exitValue;
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
XxlJobLogger.log(e);
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|