-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcssh
More file actions
executable file
·50 lines (45 loc) · 1.12 KB
/
Copy pathcssh
File metadata and controls
executable file
·50 lines (45 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
###
## cssh
## http://github.com/c3w/cssh
## Purpose: Changes OSX Terminal Profile to n per machine. Also supports tunneling #currently commented out
## Create your Terminal profiles, under Terminal Preferences
## alias ssh="~/bin/cssh"
#TUNNEL_HOST="dev"
DEFAULT_PROFILE="default"
PORT="22"
SUFFIX="mydomain.tld"
USER="myusername"
function setTerm() {
PROFILE=${1}
osascript << __EOF__
tell app "Terminal" to set current settings of first window to settings set "$PROFILE"
__EOF__
}
case "${1}" in
web*|search*|cache*)
PROFILE="webserver"
;;
jobs*|vpn*)
PROFILE="admin"
;;
dev*)
PROFILE="development"
;;
smtp*)
PROFILE="mailserver"
;;
db*)
PROFILE="database"
;;
*)
PROFILE="default"
SUFFIX=""
esac
setTerm "${PROFILE}"
if [ "${TUNNEL_HOST}" ]; then {
ssh -t ${USER}@${TUNNEL_HOST} -p ${PORT} "ssh -t root@${*}.${SUFFIX}"
} else {
ssh -p ${PORT} ${USER}@${*}.${SUFFIX}
}; fi
setTerm ${DEFAULT_PROFILE}