if ~/.ssh does not exist and cannot be created, avoid failing
This commit is contained in:
parent
10afac3fba
commit
911335247c
2 changed files with 24 additions and 20 deletions
|
@ -31,16 +31,18 @@ cd "$orig"
|
|||
# assistant.
|
||||
if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
|
||||
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
|
||||
(
|
||||
echo "#!/bin/sh"
|
||||
echo "set -e"
|
||||
echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
||||
echo "exec $base/runshell git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\""
|
||||
echo "else"
|
||||
echo "exec $base/runshell git-annex-shell -c \"\$@\""
|
||||
echo "fi"
|
||||
) > "$HOME/.ssh/git-annex-shell"
|
||||
chmod +x "$HOME/.ssh/git-annex-shell"
|
||||
if [ -e "$HOME/.ssh" ]; then
|
||||
(
|
||||
echo "#!/bin/sh"
|
||||
echo "set -e"
|
||||
echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
||||
echo "exec $base/runshell git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\""
|
||||
echo "else"
|
||||
echo "exec $base/runshell git-annex-shell -c \"\$@\""
|
||||
echo "fi"
|
||||
) > "$HOME/.ssh/git-annex-shell"
|
||||
chmod +x "$HOME/.ssh/git-annex-shell"
|
||||
fi
|
||||
fi
|
||||
|
||||
# And this shim is used by the webapp when adding a remote ssh server.
|
||||
|
|
|
@ -33,16 +33,18 @@ cd "$orig"
|
|||
# assistant.
|
||||
if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
|
||||
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
|
||||
(
|
||||
echo "#!/bin/sh"
|
||||
echo "set -e"
|
||||
echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
||||
echo "exec $base/runshell git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\""
|
||||
echo "else"
|
||||
echo "exec $base/runshell git-annex-shell -c \"\$@\""
|
||||
echo "fi"
|
||||
) > "$HOME/.ssh/git-annex-shell"
|
||||
chmod +x "$HOME/.ssh/git-annex-shell"
|
||||
if [ -e "$HOME/.ssh" ]; then
|
||||
(
|
||||
echo "#!/bin/sh"
|
||||
echo "set -e"
|
||||
echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
||||
echo "exec $base/runshell git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\""
|
||||
echo "else"
|
||||
echo "exec $base/runshell git-annex-shell -c \"\$@\""
|
||||
echo "fi"
|
||||
) > "$HOME/.ssh/git-annex-shell"
|
||||
chmod +x "$HOME/.ssh/git-annex-shell"
|
||||
fi
|
||||
fi
|
||||
|
||||
# And this shim is used by the webapp when adding a remote ssh server.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue