Created
April 19, 2016 13:23
-
-
Save treyhoover/8e80f2bba0b72ee1cc45c6dcfcb7efda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
printf '\e[38;5;196mWARNING! This is a production server!\n' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put following script in ~/bin/ssh (ensure ~/bin/ looked before /usr/bin/ in your PATH):
`#!/bin/sh
HOSTNAME=
echo $@ | sed s/.*@//
set_bg () {
osascript -e "tell application "Terminal" to set background color of window 1 to $1"
}
on_exit () {
set_bg "{0, 0, 0, 50000}"
}
trap on_exit EXIT
case $HOSTNAME in
production_hostname) set_bg "{45000, 0, 0, 50000}" ;;
*) set_bg "{0, 0, 45000, 50000}" ;;
esac
/usr/bin/ssh "$@"`