Axel Thimm 13c9f1e
#! /bin/sh
Axel Thimm 13c9f1e
Axel Thimm 13c9f1e
path="$1"
Axel Thimm 13c9f1e
Axel Thimm 13c9f1e
if dirname "$1" | grep '^[^/]' > /dev/null || test ! -d `dirname "$1"`; then
Axel Thimm 13c9f1e
  cat >&2 <
Axel Thimm 13c9f1e
$0: invalid parameter
Axel Thimm 13c9f1e
Usage: $0 PATH
Axel Thimm 13c9f1e
  PATH is the path of the instance's wiki root
Axel Thimm 13c9f1e
  The parent directories must exist.
Axel Thimm 13c9f1e
EOF
Axel Thimm 13c9f1e
fi
Axel Thimm 13c9f1e
376c120
umask 022
376c120
Axel Thimm 13c9f1e
if ! test -e "$path"; then
Axel Thimm 13c9f1e
  mkdir "$path"
Axel Thimm 13c9f1e
fi
Axel Thimm 13c9f1e
Axel Thimm 13c9f1e
if ! test -e "$path"/LocalSettings.php; then
37eafa3
  cp -a "@datadir@"/mediawiki/mw-config "$path"
Axel Thimm 13c9f1e
fi
Axel Thimm 13c9f1e
Axel Thimm 13c9f1e
if ! test -e "$path"/images; then
Axel Thimm 13c9f1e
  mkdir "$path"/images
2623847
  ln -s "@datadir@"/mediawiki/images/.htaccess "$path"/images
Axel Thimm 13c9f1e
  chown apache:apache "$path"/images
Axel Thimm 13c9f1e
fi
2623847
for f in index.php api.php extensions img_auth.php includes languages load.php \
376c120
         maintenance opensearch_desc.php resources rest.php skins \
376c120
         thumb_handler.php thumb.php vendor; do
Axel Thimm 13c9f1e
  rm -f "$path"/$f
376c120
  if test -e "@datadir@"/mediawiki/$f; then
376c120
    ln -s "@datadir@"/mediawiki/$f "$path"/$f
376c120
  fi
Axel Thimm 13c9f1e
done