aboutsummaryrefslogtreecommitdiffstats
path: root/ssh/bash-aliases
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
committerMattias Andrée <maandree@kth.se>2023-11-18 23:23:40 +0100
commit0f1df0db903ba576fd17b08197d3066af7a61e5f (patch)
treea59c04307b1382257afa3c3512ec3abadf7e0e47 /ssh/bash-aliases
parentUse losetup -d instead of --detach and add clean up (diff)
downloaddotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.gz
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.bz2
dotfiles-0f1df0db903ba576fd17b08197d3066af7a61e5f.tar.xz
A lot of changes
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'ssh/bash-aliases')
-rw-r--r--ssh/bash-aliases24
1 files changed, 24 insertions, 0 deletions
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