diff --git a/debian/i2pd.default b/debian/i2pd.default index bf6eb005..28b0e621 100644 --- a/debian/i2pd.default +++ b/debian/i2pd.default @@ -4,6 +4,7 @@ I2PD_ENABLED="yes" # port to listen for incoming connections +# comment this line if you want to use value from config I2PD_PORT="4567" # Additional options that are passed to the Daemon. diff --git a/debian/i2pd.init b/debian/i2pd.init index 8cfee8d4..02b37546 100644 --- a/debian/i2pd.init +++ b/debian/i2pd.init @@ -41,6 +41,10 @@ do_start() return 2 fi + if [ -n "$I2PD_PORT" ]; then + DAEMON_OPTS="--port $I2PD_PORT $DAEMON_OPTS" + fi + touch "$PIDFILE" chown -f $USER:adm "$PIDFILE" @@ -51,7 +55,7 @@ do_start() || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --chuid "$USER" -- \ --service --daemon --log=file --logfile=$LOGFILE --conf=$I2PCONF --tunconf=$TUNCONF \ - --port=$I2PD_PORT $DAEMON_OPTS > /dev/null 2>&1 \ + $DAEMON_OPTS > /dev/null 2>&1 \ || return 2 return $? }