aboutsummaryrefslogtreecommitdiffstats
path: root/ssh/bash-aliases
blob: d145aeeb3a8ea637bedef232823b6298f0506b29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- shell-script -*-

__gethomename () {
	if ping -c1 -W0.2 zenith >/dev/null 2>/dev/null; then
		printf '%s\n' zenith
	else
		printf '%s\n' home
	fi
}

sshhome () {
	if test -n "$DISPLAY"; then
		ssh -YC "$(__gethomename)"
	else
		ssh "$(__gethomename)"
	fi
}

sftphome () {
	sftp "$(__gethomename)"
}

alias sshz=sshhome
alias sftpz=sftphome