summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-20 13:15:01 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-20 13:15:01 -0400
commite84e20409921b7da8386b9a60fee3d2c963f77ef (patch)
tree32488ed9edc5e7b3960d9055cdd0ed7885811d31
parent81416fc94bfc597efa1849100904ebb91e77e833 (diff)
if ~/.ssh does not exist and cannot be created, avoid failing
-rwxr-xr-xstandalone/linux/skel/runshell22
-rwxr-xr-xstandalone/osx/git-annex.app/Contents/MacOS/runshell22
2 files changed, 24 insertions, 20 deletions
diff --git a/standalone/linux/skel/runshell b/standalone/linux/skel/runshell
index f6db1da13..6d846104c 100755
--- a/standalone/linux/skel/runshell
+++ b/standalone/linux/skel/runshell
@@ -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.
diff --git a/standalone/osx/git-annex.app/Contents/MacOS/runshell b/standalone/osx/git-annex.app/Contents/MacOS/runshell
index c5d689c6e..534e9707e 100755
--- a/standalone/osx/git-annex.app/Contents/MacOS/runshell
+++ b/standalone/osx/git-annex.app/Contents/MacOS/runshell
@@ -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.