From 7e0d3757436d37c238d535df12933d3875d1d331 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 21 Mar 2010 00:40:23 +0100 Subject: caretaker-shell → caretaker-ssh-command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/caretaker-ssh-command | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 examples/caretaker-ssh-command (limited to 'examples/caretaker-ssh-command') 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} +} -- cgit v1.2.3