diff options
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 | |||