diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-05-02 15:16:58 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-05-02 15:16:58 +0200 |
commit | c406cfe43ac98c040c9862a75ba2c371f364fd65 (patch) | |
tree | d1e8c127040a2a237ca6835fc81e478fd7981fe7 /examples/caretaker-ssh-command | |
parent | 30aa93f3f41c98f129f23106e736d911cbaaf902 (diff) |
Update examples/caretaker-ssh-command
Diffstat (limited to 'examples/caretaker-ssh-command')
-rwxr-xr-x | examples/caretaker-ssh-command | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/examples/caretaker-ssh-command b/examples/caretaker-ssh-command index 03f3e94..456a97d 100755 --- a/examples/caretaker-ssh-command +++ b/examples/caretaker-ssh-command @@ -8,24 +8,35 @@ # required by caretaker. However, be warned that I am no security expert, so # there might be flaws in here. Use at own risk. -# Change this to your package root -PKG_ROOT='/home/derf/var/packages_root' +# Change this to reflect your settings +PKG_PROTO='ssh' +PKG_UAH='derf@aneurysm' +PKG_PATH='/home/derf/var/packages_root' # Change this to the location of your pkglist script (if non-default) -PKG_LIST=${PKG_ROOT}/pkglist +PKG_LIST=${PKG_PATH}/pkglist args=(${(z)SSH_ORIGINAL_COMMAND}) + if [[ \ ( \ - ${args[1]} == ${PKG_LIST} && \ - ${args[2]} == ${PKG_ROOT} \ + ${args[1]} == "PKG_PATH=\"${PKG_PATH}\"" && \ + ${args[2]} == "PKG_UAH=\"${PKG_UAH}\"" && \ + ${args[3]} == "PKG_PROTO=\"${PKG_PROTO}\"" && \ + ${args[4]} == ${PKG_LIST} && \ + ${#args} == 4 \ ) || ( \ ${args[1]} == 'git-'(upload|receive)'-pack' && \ ${args[2]} != *'../'* && \ - ${args[2]} == \'${PKG_ROOT}/*\' \ + ${args[2]} == \'${PKG_ROOT}/*\' && \ + ${#args} == 2 \ ) ]] \ { - args[2]=${args[2]//\'} - ${args} + if [[ ${#args} == 2 ]] { + args[2]=${args[2]//\'} + ${args} + } else { + eval ${args} + } } |