diff --git a/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java b/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java index 5d385024f1..0683ba6e62 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/PluginStarter.java @@ -672,8 +672,20 @@ public class PluginStarter implements Runnable { // If the client is a running ClientApp that we want to stop, // bypass all the logic below. if (action.equals("stop")) { - ClientApp ca = ctx.routerAppManager().getClientApp(app.className, LoadClientAppsJob.parseArgs(app.args)); - if (ca != null && ca.getState() == ClientAppState.RUNNING) { + String[] argVal = LoadClientAppsJob.parseArgs(app.args); + // We must do all the substitution just as when started, so the + // argument array comparison in getClientApp() works. + // Do this after parsing so we don't need to worry about quoting + for (int i = 0; i < argVal.length; i++) { + if (argVal[i].indexOf("$") >= 0) { + argVal[i] = argVal[i].replace("$I2P", ctx.getBaseDir().getAbsolutePath()); + argVal[i] = argVal[i].replace("$CONFIG", ctx.getConfigDir().getAbsolutePath()); + argVal[i] = argVal[i].replace("$PLUGIN", pluginDir.getAbsolutePath()); + } + } + ClientApp ca = ctx.routerAppManager().getClientApp(app.className, argVal); + if (ca != null) { + // even if (ca.getState() != ClientAppState.RUNNING), we do this, we don't want to fall thru try { ca.shutdown(LoadClientAppsJob.parseArgs(app.stopargs)); } catch (Throwable t) { diff --git a/history.txt b/history.txt index c3af0164e4..ac488f87fe 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2014-11-12 zzz + * Plugins: Fix bug in stopping a ClientApp plugin with $parameters in the args + 2014-11-09 zzz * i2psnark: Fix tracker config form issues * Router, i2ptunnel: Add option for per-pool persistent random key, diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index f6e6df3a5c..4e28a2c8d2 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 4; + public final static long BUILD = 5; /** for example "-test" */ public final static String EXTRA = "";