diff options
author | Andrew Cady <d@jerkface.net> | 2024-01-19 12:01:49 -0500 |
---|---|---|
committer | Andrew Cady <d@jerkface.net> | 2024-01-19 12:01:49 -0500 |
commit | a74be3f9e73d9dd10eee890e673d00bfb44e5cfb (patch) | |
tree | d6ac57f28cdd7bf0283234e4730275c0b6afb565 /dot/local/bin/ssh-shellwrap | |
parent | 66a483f0101ec54bd8db0f7d20ed83fe2f615cf4 (diff) | |
parent | f58705ed7c600a1d394c6949bb7e21cfd29e6260 (diff) |
Diffstat (limited to 'dot/local/bin/ssh-shellwrap')
-rwxr-xr-x | dot/local/bin/ssh-shellwrap | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/dot/local/bin/ssh-shellwrap b/dot/local/bin/ssh-shellwrap new file mode 100755 index 0000000..e0d537e --- /dev/null +++ b/dot/local/bin/ssh-shellwrap | |||
@@ -0,0 +1,19 @@ | |||
1 | #!/bin/bash | ||
2 | # ssh wrapper; requires "--" before host argument | ||
3 | options=() | ||
4 | while [ $# -gt 0 ] | ||
5 | do | ||
6 | case $1 in | ||
7 | -- ) break ;; | ||
8 | esac | ||
9 | options+=("$1") | ||
10 | shift | ||
11 | done | ||
12 | set -e | ||
13 | [ "$1" = '--' ] | ||
14 | shift | ||
15 | [ $# -gt 0 ] | ||
16 | host=$1 | ||
17 | shift | ||
18 | ssh "${options[@]}" -- "$host" ${*@Q} | ||
19 | |||