From 45fd95e02b7340839403767ac511167c863255e9 Mon Sep 17 00:00:00 2001 From: hagen Date: Sat, 5 Dec 2015 08:41:26 +0000 Subject: [PATCH] * update default/i2pd and traditional init script --- debian/i2pd.default | 8 ++++++-- debian/i2pd.init | 13 +++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/debian/i2pd.default b/debian/i2pd.default index 3919c61e..bf6eb005 100644 --- a/debian/i2pd.default +++ b/debian/i2pd.default @@ -1,7 +1,11 @@ # Defaults for i2pd initscript # sourced by /etc/init.d/i2pd # installed at /etc/default/i2pd by the maintainer scripts +I2PD_ENABLED="yes" + +# port to listen for incoming connections +I2PD_PORT="4567" # Additional options that are passed to the Daemon. -DAEMON_OPTS="--host=1.2.3.4 --port=4567 --ircdest=irc.postman.i2p" -# change ip and port above to your external address and port +# see possible switches in /usr/share/doc/i2pd/configuration.md.gz +DAEMON_OPTS="" diff --git a/debian/i2pd.init b/debian/i2pd.init index eda135c6..ed061b04 100644 --- a/debian/i2pd.init +++ b/debian/i2pd.init @@ -13,10 +13,12 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC=i2pd # Introduce a short description here NAME=i2pd # Introduce the short server's name here -DAEMON=/usr/sbin/i2pd # Introduce the server's location here +DAEMON=/usr/sbin/$NAME # Introduce the server's location here DAEMON_OPTS="" # Arguments to run the daemon with PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME +I2PCONF=/etc/$NAME/i2pd.conf +TUNCONF=/etc/$NAME/tunnels.conf # Exit if the package is not installed [ -x $DAEMON ] || exit 0 @@ -32,10 +34,17 @@ do_start() # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started + + if [ "x$I2PD_ENABLED" != "xyes" ]; then + log_warning_msg "disabled in config" + return 2 + fi + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \ || return 1 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \ - --daemon=1 --log=1 $DAEMON_OPTS \ + --service=1 --daemon=1 --log=1 --conf=$I2PCONF --tunnelscfg=$TUNCONF \ + --port=$I2PD_PORT $DAEMON_OPTS \ || return 2 }