diff --git a/Slackware/i2p-base/rc.i2p_def b/Slackware/i2p-base/rc.i2p_def index 8e059c23d6..075e9e8472 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 d6231fa2bb..af4b19410f 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