From: root Date: Thu, 6 Nov 2008 13:55:44 +0000 (+0100) Subject: system: Add update-php.ini script. X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=5043ea49f689f67b7e7621373b6f901bc174b61a;p=matthijs%2Fservers%2Fdrsnuggles.git system: Add update-php.ini script. This script merges system php.ini with a per-site php.ini.override, to compensate for the lack of a proper include statement in php's config files. --- diff --git a/usr/local/bin/update-php.ini b/usr/local/bin/update-php.ini new file mode 100755 index 0000000..e801500 --- /dev/null +++ b/usr/local/bin/update-php.ini @@ -0,0 +1,39 @@ +#!/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 <> $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