Skip to content

Commit

Permalink
*) blanks in paths for restart and update script are replaced by back…
Browse files Browse the repository at this point in the history
…slash+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
  • Loading branch information
low012 committed Jan 21, 2008
1 parent f945ee2 commit cfd4fec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/de/anomic/server/serverSystem.java
Expand Up @@ -328,19 +328,19 @@ public static void openBrowser(String url, String app) {
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());
}
}

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());
}
Expand Down

0 comments on commit cfd4fec

Please sign in to comment.