Ignore:
Timestamp:
May 11, 2015 1:12:13 AM (5 years ago)
Author:
kytv <kytv@…>
Branches:
master
Children:
40130a8, 8303016
Parents:
f25d2a3
Message:

runplain.sh improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • installer/resources/runplain.sh

    rf25d2a3 r28786288  
    1616
    1717# Having IPv6 enabled can cause problems with certain configurations. Changing the
    18 # next value to true may help. 
     18# next value to true may help.
    1919PREFERv4="false"
    2020CP=
    2121
    22 for jars in `ls ${I2P}/lib/*.jar`; do CP=${CP}:${jars}; done
    23 JAVA=java
     22# Try using the Java binary that I2P was installed with.
     23# If it's not found, try looking in the system PATH.
     24JAVA=$(which %JAVA_HOME/bin/java || which java)
    2425
    25 if [ "`uname -s`" = "Darwin" ]; then
     26if [ -z $JAVA ] || [ ! -x $JAVA ]; then
     27    echo "Error: Cannot find java." >&2
     28    exit 1
     29fi
     30
     31for jar in `ls ${I2P}/lib/*.jar`; do
     32    if [ ! -z $CP ]; then
     33        CP=${CP}:${jar};
     34    else
     35        CP=${jar}
     36    fi
     37done
     38
     39if [ $(uname -s) = "Darwin" ]; then
    2640    export JAVA_TOOL_OPTIONS="-Djava.awt.headless=true"
    2741fi
    2842JAVAOPTS="-Djava.net.preferIPv4Stack=${PREFERv4} -Djava.library.path=${I2P}:${I2P}/lib -Di2p.dir.base=${I2P} -DloggerFilenameOverride=logs/log-router-@.txt"
    29 nohup ${JAVA} -cp "${CP}" ${JAVAOPTS} net.i2p.router.RouterLaunch > /dev/null 2>&1 &
    30 echo $! > "${I2PTEMP}/router.pid"
     43(
     44    nohup ${JAVA} -cp \"${CP}\" ${JAVAOPTS} net.i2p.router.RouterLaunch > /dev/null 2>&1
     45) &
     46PID=$!
     47
     48if [ ! -z $PID ] && kill -0 $PID > /dev/null 2>&1 ; then
     49    echo "I2P started [$PID]" >&2
     50    echo $PID > "${I2PTEMP}/router.pid"
     51else
     52    echo "I2P failed to start." >&2
     53    exit 1
     54fi
Note: See TracChangeset for help on using the changeset viewer.