Netgroups.
[profile.git] / opt / bin / sshcolourterm
index 0cf4b9f..8bae4b0 100755 (executable)
@@ -18,7 +18,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
@@ -28,8 +28,8 @@ fi
 if [ ! -z "$colour" ]; then
   colour=${colour##*/}
   colour=${colour##*:}
-  echo -e "\033]49;$colour\007"
-  clear
 fi
 
-exec ${SSHTERM_SSH:-ssh} ${1+"$@"}
+[ -n "$colour" ] && colour="-bg $colour"
+exec ${SSHTERM:-xterm} ${SSHTERM_TITLE:--title} "$1" \
+     $colour ${SSHTERM_EXEC:--e} ${SSHTERM_SSH:-ssh} ${1+"$@"}