From 0f1df0db903ba576fd17b08197d3066af7a61e5f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 18 Nov 2023 23:23:40 +0100 Subject: A lot of changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- ssh/bash-aliases | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ssh/bash-aliases (limited to 'ssh/bash-aliases') diff --git a/ssh/bash-aliases b/ssh/bash-aliases new file mode 100644 index 0000000..d145aee --- /dev/null +++ b/ssh/bash-aliases @@ -0,0 +1,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 -- cgit v1.2.3-70-g09d2