diff --git a/bash/mac-update.sh b/bash/mac-update.sh index 196bc01..a619fad 100755 --- a/bash/mac-update.sh +++ b/bash/mac-update.sh @@ -53,5 +53,7 @@ echo "unmounting and cleaning up" hdiutil detach mount_point rm -f I2P.cdr "${UPDATE_DMG}" -echo "launching I2P" -open "${BUNDLE_HOME}"/I2P.app +if [ ! -z $RESTART_I2P ]; then + echo "launching I2P" + open "${BUNDLE_HOME}"/I2P.app +fi diff --git a/java/net/i2p/update/MacUpdateProcess.java b/java/net/i2p/update/MacUpdateProcess.java index a58ad80..f780e81 100644 --- a/java/net/i2p/update/MacUpdateProcess.java +++ b/java/net/i2p/update/MacUpdateProcess.java @@ -26,6 +26,11 @@ class MacUpdateProcess implements Runnable { env.put("I2P_PID", System.getProperty("router.pid")); env.put("I2P_VERSION", version); env.put("BUNDLE_HOME", System.getProperty("mac.bundle.location")); + env.remove("RESTART_I2P"); + + int exitCode = ctx.router().scheduledGracefulExitCode(); + if (exitCode == Router.EXIT_HARD_RESTART || exitCode == Router.EXIT_GRACEFUL_RESTART) + env.put("RESTART_I2P","true"); try { var process = pb.