* update default init-script : make --port optional

This commit is contained in:
hagen 2016-05-29 00:00:00 +00:00
parent 44eccd85fd
commit ea8e1be294
2 changed files with 6 additions and 1 deletions

1
debian/i2pd.default vendored
View file

@ -4,6 +4,7 @@
I2PD_ENABLED="yes" I2PD_ENABLED="yes"
# port to listen for incoming connections # port to listen for incoming connections
# comment this line if you want to use value from config
I2PD_PORT="4567" I2PD_PORT="4567"
# Additional options that are passed to the Daemon. # Additional options that are passed to the Daemon.

6
debian/i2pd.init vendored
View file

@ -41,6 +41,10 @@ do_start()
return 2 return 2
fi fi
if [ -n "$I2PD_PORT" ]; then
DAEMON_OPTS="--port $I2PD_PORT $DAEMON_OPTS"
fi
touch "$PIDFILE" touch "$PIDFILE"
chown -f $USER:adm "$PIDFILE" chown -f $USER:adm "$PIDFILE"
@ -51,7 +55,7 @@ do_start()
|| return 1 || return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --chuid "$USER" -- \ start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --chuid "$USER" -- \
--service --daemon --log=file --logfile=$LOGFILE --conf=$I2PCONF --tunconf=$TUNCONF \ --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 2
return $? return $?
} }