summaryrefslogtreecommitdiff
path: root/examples/caretaker-ssh-command
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-03-21 00:40:23 +0100
committerDaniel Friesel <derf@derf.homelinux.org>2010-03-21 00:40:23 +0100
commit7e0d3757436d37c238d535df12933d3875d1d331 (patch)
treeaff6596625acbf87dec09a327f713d2aba562583 /examples/caretaker-ssh-command
parent8e36ec6d4a5ca8030822cb4cbefccfeb95ac92e9 (diff)
caretaker-shell → caretaker-ssh-command
Diffstat (limited to 'examples/caretaker-ssh-command')
-rwxr-xr-xexamples/caretaker-ssh-command23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/caretaker-ssh-command b/examples/caretaker-ssh-command
new file mode 100755
index 0000000..ce59a90
--- /dev/null
+++ b/examples/caretaker-ssh-command
@@ -0,0 +1,23 @@
+#!/usr/bin/env zsh
+
+# Change this to your package root
+PKG_ROOT='/home/derf/var/packages_root'
+
+# Change this to the location of your pkglist script (if non-default)
+PKG_LIST=${PKG_ROOT}/pkglist
+
+args=(${(z)SSH_ORIGINAL_COMMAND})
+
+if [[ \
+ ( \
+ $args[1] == ${PKG_LIST} && \
+ $args[2] == ${PKG_ROOT} \
+ ) || ( \
+ $args[1] == 'git-'(upload|receive)'-pack' && \
+ $args[2] != *'../'* && \
+ $args[2] == \'${PKG_ROOT}/*\' \
+ ) \
+]] {
+ args[2]=${args[2]//\'}
+ ${args}
+}