3 # ktmux: Start tmux and ktmux_helper.
4 # Usage: ktmux [options]
5 # Options: -I <path> Pass path to kinit through to ktmux_helper.
6 # -L <path> Pass path to klist through to ktmux_helper.
7 # -R <path> Pass path to krenew through to ktmux_helper.
8 # -T <path> Path to tmux.
9 # -n <name> Window name for new tmux session.
10 # -s <name> Session name for new tmux session.
11 # -t <name> Target session name for new tmux session.
18 while getopts ":I:L:R:T:n:s:t:" opt; do
20 I|L|R) helper_opts="$helper_opts -$opt $OPTARG";;
21 T) tmux="$OPTARG"; helper_opts="$helper_opts -$opt $OPTARG";;
22 n|s|t) session_opts="$session_opts -$opt $OPTARG";;
27 if [ -z "$KRB5CCNAME" ]; then
28 krb5ccname="$KRB5CCNAME"
29 [ -z "$krb5ccname" ] && krb5ccname=FILE:${TMPDIR:-/tmp}/krb5cc_${UID}_ktmux_$$
30 export KRB5CCNAME="$krb5ccname"
34 exec $tmux ${tmux_opts## } new-session ${session_opts## } -d ';' set-environment KRB5CCNAME "$KRB5CCNAME" ';' attach ';' run-shell "ktmux_helper ${helper_opts## }"