36 lines
875 B
Bash
36 lines
875 B
Bash
#! /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
|
|
|
|
umask 022
|
|
|
|
if ! test -e "$path"; then
|
|
mkdir "$path"
|
|
fi
|
|
|
|
if ! test -e "$path"/LocalSettings.php; then
|
|
cp -a "@datadir@"/mediawiki/mw-config "$path"
|
|
fi
|
|
|
|
if ! test -e "$path"/images; then
|
|
mkdir "$path"/images
|
|
ln -s "@datadir@"/mediawiki/images/.htaccess "$path"/images
|
|
chown apache:apache "$path"/images
|
|
fi
|
|
for f in index.php api.php extensions img_auth.php includes languages load.php \
|
|
maintenance opensearch_desc.php resources rest.php skins \
|
|
thumb_handler.php thumb.php vendor; do
|
|
rm -f "$path"/$f
|
|
if test -e "@datadir@"/mediawiki/$f; then
|
|
ln -s "@datadir@"/mediawiki/$f "$path"/$f
|
|
fi
|
|
done
|