Files
i2p.i2p/apps/i2psnark/launch-i2psnark

41 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
#
# This launches i2psnark and jetty in a separate jvm.
# The file jetty-i2psnark.xml must be present in the current directory.
# i2psnark will be accessed at http://127.0.0.1:8002/
#
# Raise the soft open files soft ulimit to this value, if able
OPEN_FILES_ULIMIT=2048
# Increase memory to 512 MB
JAVA_OPTS='-Xmx512m'
raiseopenfilesulimit() {
OPEN_FILES_SOFT=`ulimit -S -n` 2> /dev/null || return
if [ "$OPEN_FILES_SOFT" != "unlimited" ]
then
if [ "$OPEN_FILES_ULIMIT" -gt "$OPEN_FILES_SOFT" ]
then
OPEN_FILES_HARD=`ulimit -H -n` 2> /dev/null || return
if [ "$OPEN_FILES_HARD" != "unlimited" ]
then
if [ "$OPEN_FILES_ULIMIT" -gt "$OPEN_FILES_HARD" ]
then
OPEN_FILES_ULIMIT="$OPEN_FILES_HARD"
fi
fi
if [ "$OPEN_FILES_ULIMIT" -gt "$OPEN_FILES_SOFT" ]
then
ulimit -S -n "$OPEN_FILES_ULIMIT" > /dev/null 2>&1
fi
fi
fi
}
raiseopenfilesulimit
I2P="`dirname $0`"
cd "$I2P"
java $JAVA_OPTS -jar i2psnark.jar