From 562189bb367ca4017f5c0869da2a26698fded15e Mon Sep 17 00:00:00 2001 From: Mar2zz Date: Fri, 23 Dec 2011 19:19:59 +0100 Subject: [PATCH] Options to specify port in startup script --- default.ubuntu | 3 +++ initd.ubuntu | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/default.ubuntu b/default.ubuntu index 139bf640..9d3e822b 100644 --- a/default.ubuntu +++ b/default.ubuntu @@ -28,6 +28,9 @@ CONFIG= # otherwise, the default location (~/.couchpotato) is used: DATADIR= +# [optional] Force port number to listen on, otherwise the one set in config.ini is used: +PORT= + # [optional] full path for the pidfile # otherwise, the default location /var/run/couchpotato/couchpotato.pid is used: PID_FILE= diff --git a/initd.ubuntu b/initd.ubuntu index 6b673c44..88e68d1a 100755 --- a/initd.ubuntu +++ b/initd.ubuntu @@ -30,7 +30,7 @@ SETTINGS_LOADED=FALSE DESC=CouchPotato # only accept values from /etc/default/couchpotato -unset RUN_AS CONFIG DATADIR PID_FILE +unset RUN_AS CONFIG DATADIR PORT PID_FILE . /lib/lsb/init-functions @@ -74,6 +74,7 @@ load_settings() { [ -z "$CONFIG" ] && DAEMON_OPTS="$DAEMON_OPTS --config=/home/$RUN_AS/.couchpotato/config.ini" [ -n "$DATADIR" ] && DAEMON_OPTS="$DAEMON_OPTS --datadir=$DATADIR" [ -z "$DATADIR" ] && DAEMON_OPTS="$DAEMON_OPTS --datadir=/home/$RUN_AS/.couchpotato" + [ -n "$PORT" ] && DAEMON_OPTS="$DAEMON_OPTS --port=$PORT" if ! [ -n "$PID_FILE" ]; then PID_FILE=/var/run/couchpotato/couchpotato.pid fi