*) blanks in paths for restart and update script are replaced by backslash+blank now (see http://forum.yacy-websuche.de/viewtopic.php?t=745)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4351 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 17 years ago
parent f945ee21d2
commit cfd4fecd12

@ -328,7 +328,7 @@ public final class serverSystem {
public static void deployScript(File scriptFile, String theScript) throws IOException {
serverFileUtils.write(theScript.getBytes(), scriptFile);
try {
Runtime.getRuntime().exec("chmod 755 " + scriptFile.getAbsolutePath()).waitFor();
Runtime.getRuntime().exec("chmod 755 " + scriptFile.getAbsolutePath().replaceAll(" ", "\\ ")).waitFor();
} catch (InterruptedException e) {
throw new IOException(e.getMessage());
}
@ -336,11 +336,11 @@ public final class serverSystem {
public static void execAsynchronous(File scriptFile) throws IOException {
// runs a unix/linux script as separate thread
File starterFile = new File(scriptFile.getAbsolutePath() + ".starter.sh");
File starterFile = new File(scriptFile.getAbsolutePath().replaceAll(" ", "\\ ") + ".starter.sh");
//deployScript(starterFile, "touch restart.starter.startet1");
deployScript(starterFile, "#!/bin/sh" + serverCore.LF_STRING + scriptFile.getAbsolutePath() + " &" + serverCore.LF_STRING);
deployScript(starterFile, "#!/bin/sh" + serverCore.LF_STRING + scriptFile.getAbsolutePath().replaceAll(" ", "\\ ") + " &" + serverCore.LF_STRING);
try {
Runtime.getRuntime().exec(starterFile.getAbsolutePath()).waitFor();
Runtime.getRuntime().exec(starterFile.getAbsolutePath().replaceAll(" ", "\\ ")).waitFor();
} catch (InterruptedException e) {
throw new IOException(e.getMessage());
}

Loading…
Cancel
Save