X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=opt%2Fbin%2Fktmux;h=eb590dae66f1e3931f417264045d45ddeafd1ff2;hp=d0c063c48c4e28a1e7dab47cbf605270f2e9a685;hb=59c39198581757eee1fc00cb707e0d60e5a7df0b;hpb=c23dc0b9470e74a417e8eb796920d7da87eb243d diff --git a/opt/bin/ktmux b/opt/bin/ktmux index d0c063c..eb590da 100755 --- a/opt/bin/ktmux +++ b/opt/bin/ktmux @@ -11,4 +11,11 @@ while getopts ":T:n:s:t:" opt; do done shift $((OPTIND-1)) -exec $tmux ${tmux_opts## } new-session ${session_opts## } -d ';' attach ';' run-shell ktmux_helper +if [ -z "$KRB5CCNAME" ]; then + krb5ccname="$KRB5CCNAME" + [ -z "$krb5ccname" ] && krb5ccname=FILE:${TMPDIR:-/tmp}/krb5cc_${UID}_ktmux_$$ + export KRB5CCNAME="$krb5ccname" +fi +klist -s || kinit + +exec $tmux ${tmux_opts## } new-session ${session_opts## } -d ';' set-environment KRB5CCNAME "$KRB5CCNAME" ';' attach ';' run-shell ktmux_helper