X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=opt%2Fbin%2Fsshcolourterm;h=82ecf586df6420676768b3833126c16ec7ab0af1;hb=33e89a52bbbf10cc2294c7589711b17d7470dfcc;hp=4a5f302ef913aa0703a6fa704b7ff33211e0675b;hpb=80c177c858de9318b83e4491be0cba7854f9144f;p=profile.git diff --git a/opt/bin/sshcolourterm b/opt/bin/sshcolourterm index 4a5f302..82ecf58 100755 --- a/opt/bin/sshcolourterm +++ b/opt/bin/sshcolourterm @@ -2,6 +2,15 @@ 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= @@ -18,7 +27,7 @@ fi # 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 @@ -30,6 +39,6 @@ if [ ! -z "$colour" ]; then colour=${colour##*:} fi -[ -n "$colour" ] && colour="-bg $colour" -exec ${SSHTERM:-xterm} ${SSHTERM_TITLE:--title} "$1" \ +[ -n "$colour" ] && colour="-bg $colour -bd $colour" +exec ${SSHTERM:-xterm} ${SSHTERM_TITLE:--title} "$title" \ $colour ${SSHTERM_EXEC:--e} ${SSHTERM_SSH:-ssh} ${1+"$@"}