--- /dev/null
+#!/bin/sh
+
+# This script will merge the main php.ini with site specific additions into a site specific php.ini.
+
+BASE=/etc/php5/cgi/php.ini
+SITES=/data/www/*
+CONFIN=conf/php.ini.override
+CONFOUT=conf/php.ini
+
+for SITE in $SITES; do
+ IN=$SITE/$CONFIN
+ OUT=$SITE/$CONFOUT
+ if [ \! -r $IN ]; then
+ continue;
+ fi
+ echo "Updating $OUT"
+
+ cat > $OUT <<EOF
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; This file is autogenerated by $0
+;
+; Do NOT edit this file directly.
+;
+; You should instead edit $IN and run $0 afterwards.
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+;;; Begin included $BASE ;;;
+
+EOF
+
+ cat $BASE >> $OUT
+ echo -e "\n;;; End included $BASE ;;;\n" >> $OUT
+ echo -e "\n;;; Begin included $IN ;;;\n" >> $OUT
+ cat $IN >> $OUT
+ echo -e "\n;;; End included $IN ;;;\n" >> $OUT
+done