if ~/.ssh does not exist and cannot be created, avoid failing

This commit is contained in:
Joey Hess 2015-04-20 13:15:01 -04:00
parent 10afac3fba
commit 911335247c
2 changed files with 24 additions and 20 deletions

View file

@ -31,6 +31,7 @@ cd "$orig"
# assistant.
if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
if [ -e "$HOME/.ssh" ]; then
(
echo "#!/bin/sh"
echo "set -e"
@ -41,6 +42,7 @@ if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
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.

View file

@ -33,6 +33,7 @@ cd "$orig"
# assistant.
if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
if [ -e "$HOME/.ssh" ]; then
(
echo "#!/bin/sh"
echo "set -e"
@ -43,6 +44,7 @@ if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
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.