Run all scripts in a sub-directory
for SCRIPT in $DIR/post-receive.d/*


You might want to limit that to only *.sh pattern, just for clarity.

Personally I'm a fan of the one-line-style, but that's personal preference:

for ITEM in SET; do
if [ CONDITION ]; then


And yes, input from stdin is at the moment ignored completely by your script. Reading from stdin can be done via the read command, like this.

#!/bin/sh

# This whill be our input variable
input=""

# Read the first line without adding
# a new line to the start.
read input

# Start reading from stdin
while read line; do
    # Concate the input into our variable
    input=$input"\n"$line
done

# Echo it...what else?
echo $input


After doing that you can pipe the variable into the scripts like this:

echo $INPUT | "$SCRIPT"


One word of warning: I'm not sure if this is BASH only or cross-shell compatible.