From 3998ce311fd69e8df8edbdaf409e9db5e2083c1a Mon Sep 17 00:00:00 2001 From: sponge Date: Fri, 22 Oct 2010 02:26:13 +0000 Subject: [PATCH] Fix rc.i2p for slackware package --- Slackware/i2p-base/rc.i2p_def | 21 +++++++++++++++++++-- history.txt | 3 +++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Slackware/i2p-base/rc.i2p_def b/Slackware/i2p-base/rc.i2p_def index 8e059c23d..075e9e847 100644 --- a/Slackware/i2p-base/rc.i2p_def +++ b/Slackware/i2p-base/rc.i2p_def @@ -2,15 +2,32 @@ # Start/stop i2p service. i2p_start() { - /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory start )" + # Check if router is up first! + /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory status )" > /dev/null + if [ ! $? -eq 0 ] ; then { + # I2p is already running, so tell the user. + echo "I2P is already running..." + i2p_status + } + else + { + # Just in-case there are leftover junk in /tmp... + rm -Rf `grep /tmp/hsperfdata_root/* -le i2p` /tmp/i2p-*.tmp /tmp/router.ping + # Now that all junk is cleaned up, start. + /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory start )" + } + fi } i2p_stop() { /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory stop )" + rm -Rf `grep /tmp/hsperfdata_root/* -le i2p` /tmp/i2p-*.tmp /tmp/router.ping } i2p_restart() { - /bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory restart)" + # We want a FULL cycle here, not the wrappers idea of this! + i2p_stop + i2p_start } i2p_status() { diff --git a/history.txt b/history.txt index d6231fa2b..af4b19410 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2010-10-22 sponge + * Fix rc.i2p for slackware package + 2010-10-10 sponge * Fulfill Request for name resolving in BOB