#! /bin/bash INIFILE=mediawiki.ini if [ ! -r "`dirname $0`/$INIFILE" ]; then echo "Error: INI file $INIFILE not found" >&2 exit 1 fi PHPINIDIR="`rpm -ql apache2-mod_php5 | grep "/etc/php/.*/apache2-mod_php/php.d"`" if [ ! -d "$PHPINIDIR" ]; then echo "Error: php.d/ dir not found ($PHPINIDIR)" >&2 exit 1 fi if [ ! -w "$PHPINIDIR" ]; then echo "Error: $PHPINIDIR/ dir is not writable" >&2 exit 1 fi if [ -e "$PHPINIDIR/$INIFILE" ]; then echo "Error: INI file $PHPINIDIR/$INIFILE already exists." >&2 exit 1 fi echo "First, set restricted mode:" control apache2-mod_php5 restricted && echo "Done." || echo "Error!" echo "Copy PHP config to $PHPINIDIR/" /bin/cp "`dirname $0`/$INIFILE" $PHPINIDIR/ && echo "Done." || echo "Error!" echo "Restart HTTPD2 daemon if need" service httpd2 condrestart