Files
i2p.itoopie/Slackware/i2p-base/rc.i2p_def

69 lines
1.5 KiB
Plaintext
Raw Normal View History

2009-02-01 07:51:38 +00:00
#!/bin/sh
# Start/stop i2p service.
i2p_start() {
2010-10-22 02:26:13 +00:00
# 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
2009-02-01 07:51:38 +00:00
}
i2p_stop() {
/bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory stop )"
2010-10-22 02:26:13 +00:00
rm -Rf `grep /tmp/hsperfdata_root/* -le i2p` /tmp/i2p-*.tmp /tmp/router.ping
2009-02-01 07:51:38 +00:00
}
2009-11-04 10:27:02 +00:00
i2p_restart() {
2010-10-22 02:26:13 +00:00
# We want a FULL cycle here, not the wrappers idea of this!
i2p_stop
i2p_start
2009-11-04 10:27:02 +00:00
}
i2p_status() {
/bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory status )"
}
i2p_console() {
/bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory console )"
}
i2p_dump() {
/bin/su - -c "( export PATH=\"$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin\"; directory dump )"
}
2009-02-01 07:51:38 +00:00
case "$1" in
'start')
i2p_start
;;
'stop')
i2p_stop
;;
'restart')
2009-11-04 10:27:02 +00:00
i2p_restart
;;
'status')
i2p_status
;;
'console')
i2p_console
;;
'dump')
i2p_dump
2009-02-01 07:51:38 +00:00
;;
*)
2009-11-04 10:27:02 +00:00
echo "usage $0 start|stop|restart|status|console|dump"
2009-02-01 07:51:38 +00:00
;;
esac