Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ssh() {
- #get last argument
- for HOST; do true; done
- #if it's not an alias just use white
- if [[ $HOST == *"@"* ]]; then
- COLOR=7
- else
- #read in config to find color for alias
- #start color from blue
- COLOR=1
- while read line; do
- if [[ $line == "Host "$HOST* ]]; then
- break
- elif [[ $line == "Host "* ]]; then
- COLOR=$((COLOR+1))
- if [[ $COLOR -gt "6" ]]; then
- #don't use white for custom hosts
- COLOR=1
- fi
- fi
- done < ~/.ssh/config
- fi
- /usr/bin/ssh -t "$*" 'tput bold && tput setf '$COLOR'; bash -l'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement