Skip to content

Instantly share code, notes, and snippets.

@treyhoover
Created April 19, 2016 13:23
Show Gist options
  • Save treyhoover/8e80f2bba0b72ee1cc45c6dcfcb7efda to your computer and use it in GitHub Desktop.
Save treyhoover/8e80f2bba0b72ee1cc45c6dcfcb7efda to your computer and use it in GitHub Desktop.
printf '\e[38;5;196mWARNING! This is a production server!\n'
@treyhoover
Copy link
Author

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 "$@"`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment