Use a different escape sequence for magenta.
[profile.git] / sshcolourterm
1 #!/bin/bash
2 #
3 # $Id$
4 #
5
6 SSHCOLOURS=~/.ssh/colours
7
8 fqdn=${1##*@}
9 colour=
10
11 # Get colour by regex.
12 for path in $(ls "$SSHCOLOURS" | lensort -r); do
13   re=${path##*/}
14   echo "$fqdn" | grep -qs "$re" || continue
15   colour=$(readlink "$SSHCOLOURS/$path")
16   break
17 done
18
19 if [ ! -z "$colour" ]; then
20   colour=${colour##*/}
21   colour=${colour##*:}
22   echo -e "\033]49;$colour\007"
23   clear
24 fi
25
26 exec ${SSHTERM_SSH:-ssh} ${1+"$@"}