diff options
author | Joe <rrbo@proton.me> | 2022-10-20 17:22:05 +0200 |
---|---|---|
committer | Joe <rrbo@proton.me> | 2022-10-20 17:22:05 +0200 |
commit | 087bf5f41bf399471bba828392d9ac349e4e15ee (patch) | |
tree | 1fdb1d3b3e306a51c960e254ef4cfe26e6feeae6 /.config/zsh | |
parent | up (diff) | |
download | dotfiles-bsd-087bf5f41bf399471bba828392d9ac349e4e15ee.tar.gz dotfiles-bsd-087bf5f41bf399471bba828392d9ac349e4e15ee.tar.bz2 dotfiles-bsd-087bf5f41bf399471bba828392d9ac349e4e15ee.tar.xz dotfiles-bsd-087bf5f41bf399471bba828392d9ac349e4e15ee.tar.zst dotfiles-bsd-087bf5f41bf399471bba828392d9ac349e4e15ee.zip |
bssh bup
Diffstat (limited to '.config/zsh')
-rw-r--r-- | .config/zsh/alias.zsh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/.config/zsh/alias.zsh b/.config/zsh/alias.zsh index a180727..4998eca 100644 --- a/.config/zsh/alias.zsh +++ b/.config/zsh/alias.zsh @@ -65,6 +65,29 @@ alias \ bssh() { user='rbousset' host='bastion' + if [ -z "$1" ]; then + ssh $user@$host -- --osh + return + fi + if [ "$1" != "--osh" ]; then + tmp="$1" + shift 1 + if ! grep -F '@' <<< "$tmp" >/dev/null 2>&1; then + ssh $user@$host -t -- root@"$tmp" $* + else + ssh $user@$host -t -- "$tmp" $* + fi + else + ssh $user@$host -t -- $* + fi +} +assh() { + user='admin' + host='bastion' + if [ -z "$1" ]; then + ssh $user@$host -- --osh + return + fi if [ "$1" != "--osh" ]; then tmp="$1" shift 1 |