From cfd4fecd127073db673766fc8ba791ec6f9de9a0 Mon Sep 17 00:00:00 2001 From: low012 Date: Mon, 21 Jan 2008 18:04:08 +0000 Subject: [PATCH] *) 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 --- source/de/anomic/server/serverSystem.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/de/anomic/server/serverSystem.java b/source/de/anomic/server/serverSystem.java index 951a75416..9f8afbc0c 100644 --- a/source/de/anomic/server/serverSystem.java +++ b/source/de/anomic/server/serverSystem.java @@ -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()); }