#! /bin/sh path="$1" if dirname "$1" | grep '^[^/]' > /dev/null || test ! -d `dirname "$1"`; then cat >&2 <<EOF $0: invalid parameter Usage: $0 PATH PATH is the path of the instance's wiki root The parent directories must exist. EOF fi if ! test -e "$path"; then mkdir "$path" fi if ! test -e "$path"/LocalSettings.php; then cp -a "@datadir@"/mediawiki/config "$path" fi if ! test -e "$path"/images; then mkdir "$path"/images chown apache:apache "$path"/images fi for f in index.php api.php opensearch_desc.php; do rm -f "$path"/$f ln -s "@datadir@"/mediawiki/$f "$path"/$f done