#!/bin/bash | |
GITPATH="/srv/repositories/" | |
GIT_TOOLS=$(readlink -f $(dirname $0)) | |
umask 0022 | |
for path in $(find -L $GITPATH -type d -name hooks) ; do | |
HOOKFILE="${path}/post-update" | |
if [ ! -f $HOOKFILE ] | |
then | |
# hook file does not exist, create (link) | |
ln -s ${GIT_TOOLS}/git-hooks/post-update $HOOKFILE | |
fi | |
done |