Changeset 28786288


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

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • debian/patches/0001-path-substitution.patch

    rf25d2a3 r28786288  
    148148 then
    149149     COMMAND="$FIXED_COMMAND"
    150 @@ -1055,7 +979,6 @@
     150@@ -1058,7 +982,6 @@
    151151         if [ "X$pid" = "X" ]
    152152         then
     
    156156             eval echo ' running: PID:$pid'
    157157         fi
    158 @@ -1858,7 +1781,7 @@
     158@@ -1861,7 +1784,7 @@
    159159 }
    160160 
     
    165165 
    166166 checkifstartingasroot() {
    167 @@ -1866,7 +1789,7 @@
     167@@ -1869,7 +1792,7 @@
    168168         echo "`gettext 'Running I2P as the root user is *not* recommended.'`"
    169169         showsetusermesg
     
    174174     fi
    175175 }
    176 @@ -1931,24 +1854,10 @@
     176@@ -1934,24 +1857,10 @@
    177177             status
    178178             ;;
     
    215215 
    216216 # Having IPv6 enabled can cause problems with certain configurations. Changing the
    217  # next value to true may help. 
     217 # next value to true may help.
    218218--- a/installer/resources/wrapper.config
    219219+++ b/installer/resources/wrapper.config
  • 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.