From 017cb1bd591750accb92e88023b84b69feba91aa Mon Sep 17 00:00:00 2001 From: chros Date: Thu, 25 Aug 2016 19:04:11 +0100 Subject: [PATCH] Fixing variables in rtorrentInitTmux.bash script (See #10) --- doc/scripts/init/rtorrentInitTmux.bash | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/doc/scripts/init/rtorrentInitTmux.bash b/doc/scripts/init/rtorrentInitTmux.bash index 5af84337..1b93cc79 100755 --- a/doc/scripts/init/rtorrentInitTmux.bash +++ b/doc/scripts/init/rtorrentInitTmux.bash @@ -65,13 +65,12 @@ options="" tmuxname="rtorrent" # name of window in tmux session -DESC="rT" +tmuxwindowname="rT" ####################### ###END CONFIGURATION### ####################### PATH=/usr/bin:/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin NAME=rtorrent -DDIR="/opt/rtorrent/bin" DAEMON=$NAME SCRIPTNAME=/etc/init.d/$NAME RTXMLRPCBIN="$base/bin/rtxmlrpc" @@ -118,7 +117,7 @@ d_start() { fi # start rtorrent always in the 3rd tmux window (2) if it's not running and leave shell behind to be able to see reason of a crash if [ "$(status)" == "" ]; then - su -c "tmux -2u list-panes -t ${tmuxname}:2 &>/dev/null && tmux -2u respawn-pane -t ${tmuxname}:2 -k \"${DDIR}/${DAEMON} ${options}; bash\" || tmux -2u new-window -t ${tmuxname}:2 -n ${DESC} \"${DDIR}/${DAEMON} ${options}; bash\"" $user + su -c "tmux -2u list-panes -t ${tmuxname}:2 &>/dev/null && tmux -2u respawn-pane -t ${tmuxname}:2 -k \"${DAEMON} ${options}; bash\" || tmux -2u new-window -t ${tmuxname}:2 -n ${tmuxwindowname} \"${DAEMON} ${options}; bash\"" $user fi } @@ -139,17 +138,17 @@ checkcnfg case "$1" in start) - echo -n "Starting $DESC: $NAME" + echo -n "Starting $tmuxwindowname: $NAME" d_start echo "." ;; stop) - echo -n "Stopping $DESC: $NAME" + echo -n "Stopping $tmuxwindowname: $NAME" d_stop echo "." ;; restart|force-reload) - echo -n "Restarting $DESC: $NAME" + echo -n "Restarting $tmuxwindowname: $NAME" d_stop sleep 1 d_start