From fe30b7850bf867b45fb233f351012c97a1b9d068 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Fri, 15 Apr 2011 16:09:18 +0100 Subject: [PATCH] Allow specifying path to tmux. ktmux_helper needs to call tmux to open a new window for kinit but it won't be able to if it doesn't know where tmux is. --- opt/bin/ktmux | 2 +- opt/bin/ktmux_helper | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/opt/bin/ktmux b/opt/bin/ktmux index 9d88576..9545c36 100755 --- a/opt/bin/ktmux +++ b/opt/bin/ktmux @@ -18,7 +18,7 @@ session_opts= while getopts ":I:L:R:T:n:s:t:" opt; do case $opt in I|L|R) helper_opts="$helper_opts -$opt $OPTARG";; - T) tmux="$OPTARG";; + T) tmux="$OPTARG"; helper_opts="$helper_opts -$opt $OPTARG";; n|s|t) session_opts="$session_opts -$opt $OPTARG";; esac done diff --git a/opt/bin/ktmux_helper b/opt/bin/ktmux_helper index fe942d4..0e48ad4 100755 --- a/opt/bin/ktmux_helper +++ b/opt/bin/ktmux_helper @@ -5,6 +5,7 @@ # Options: -I Specify path to kinit. # -L Specify path to klist. # -R Specify path to krenew. +# -T Specify path to tmux. # Notes: Doesn't handle multiple sessions properly. # @@ -27,11 +28,12 @@ exit 0 if $tmux_helper; $tmux_helper = $$; my %opts; -getopts('I:L:R:', \%opts); +getopts('I:L:R:T:', \%opts); my $kinit = $opts{'I'} || "kinit"; my $klist = $opts{'L'} || "klist"; my $krenew = $opts{'R'} || "krenew"; +my $tmux = $opts{'T'} || "tmux"; my $exitasap = 0; my $pid = 0; @@ -111,7 +113,7 @@ sub check_credentials { sub want_credentials { # Do we already know? return sleep 1 if &check_kinit_child; - system "tmux", "new-window", "-n", "Renew Kerberos credentials", "exec $kinit"; + system $tmux, "new-window", "-n", "Renew Kerberos credentials", "exec $kinit"; } sub cleanup { -- 2.7.4