/** * Run the given command as a process within the supplied instance config context * and wait until it finalizes. An ElasticsearchSetupException is thrown if the exit code * is not 0. * @param config - the instance config * @param command - the command to execute * @param environment - a map of environment variables; can be null * @param processDestroyer - a destroyer handler for the spawned process; can be null * @return the output (not trimmed of whitespaces) of the given command, as separate lines */ public static List<String> executeScript(InstanceConfiguration config, CommandLine command, Map<String, String> environment, ProcessDestroyer processDestroyer) { return executeScript(config, command, environment, processDestroyer, false); }