git://git.iain.cx/iain
/
profile.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow specifying path to tmux.
[profile.git]
/
opt
/
bin
/
sshcolourterm
diff --git
a/opt/bin/sshcolourterm
b/opt/bin/sshcolourterm
index
4a5f302
..
e143a75
100755
(executable)
--- a/
opt/bin/sshcolourterm
+++ b/
opt/bin/sshcolourterm
@@
-2,6
+2,15
@@
SSHCOLOURS=~/.ssh/colours
SSHCOLOURS=~/.ssh/colours
+while getopts ":t:" opt; do
+ case "$opt" in
+ t) title="$OPTARG";;
+ esac
+done
+shift $((OPTIND-1))
+
+[ -z "$title" ] && title="$1"
+
fqdn=${1##*@}
colour=
fqdn=${1##*@}
colour=
@@
-18,7
+27,7
@@
fi
# Get colour by netgroup.
if [ -z "$colour" ]; then
for netgroup in $(ls "$SSHCOLOURS" | grep ^\@); do
# Get colour by netgroup.
if [ -z "$colour" ]; then
for netgroup in $(ls "$SSHCOLOURS" | grep ^\@); do
- if netgroups $netgroup ${fqdn%%.*}
2
>/dev/null; then
+ if netgroups $netgroup ${fqdn%%.*}
&
>/dev/null; then
colour=$(readlink "$SSHCOLOURS/$netgroup")
break
fi
colour=$(readlink "$SSHCOLOURS/$netgroup")
break
fi
@@
-31,5
+40,5
@@
if [ ! -z "$colour" ]; then
fi
[ -n "$colour" ] && colour="-bg $colour"
fi
[ -n "$colour" ] && colour="-bg $colour"
-exec ${SSHTERM:-xterm} ${SSHTERM_TITLE:--title} "$
1
" \
+exec ${SSHTERM:-xterm} ${SSHTERM_TITLE:--title} "$
title
" \
$colour ${SSHTERM_EXEC:--e} ${SSHTERM_SSH:-ssh} ${1+"$@"}
$colour ${SSHTERM_EXEC:--e} ${SSHTERM_SSH:-ssh} ${1+"$@"}