summaryrefslogtreecommitdiff
path: root/standalone
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-29 14:40:28 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-29 14:40:28 -0400
commit12315e98515eb97ba8fa58f2aa44d6ed3ae977d6 (patch)
treef72e81b5d4701e7313fdee6a0837dac9f8e3325b /standalone
parent48cb08ed2237e0630459e4a70341e129426bded9 (diff)
The standalone tarball's runshell now takes care of installing a ~/.ssh/git-annex-shell wrapper the first time it's run.
Diffstat (limited to 'standalone')
-rwxr-xr-xstandalone/linux/runshell13
1 files changed, 13 insertions, 0 deletions
diff --git a/standalone/linux/runshell b/standalone/linux/runshell
index da26cd3ba..82d3ce2c5 100755
--- a/standalone/linux/runshell
+++ b/standalone/linux/runshell
@@ -26,6 +26,19 @@ cd "$base"
base="$(pwd)"
cd "$orig"
+# Install shim that's used to run git-annex-shell from ssh authorized_keys.
+# The assistant also does this when run, but the user may not be using the
+# assistant.
+if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then
+ mkdir "$HOME/.ssh" >/dev/null 2>&1 || true
+ (
+ echo "#!/bin/sh"
+ echo "set -e"
+ echo "exec $base/runshell git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\""
+ ) > "$HOME/.ssh/git-annex-shell"
+ chmod +x "$HOME/.ssh/git-annex-shell"
+fi
+
# Put our binaries first, to avoid issues with out of date or incompatable
# system binaries.
PATH=$base/bin:$PATH