Mediawiki/mw-setup.sh

From Segfault
Jump to navigation Jump to search
#!/bin/sh
#
# (C)2009, lists@nerdbynature.de
# Set up a Mediawiki instance by creating symlinks
#
if [ ! -d "$1" ]; then
        echo "Usage: `basename $0` [dir]"
        exit 1
else
        DIR="$1"
fi

# unset me!
# DEBUG=echo

for i in `ls "$DIR" | egrep -v 'COPYING|CREDITS|FAQ|HISTORY|INSTALL|Makefile|README|RELEASE|UPGRADE'`; do
        if [ ! -e $i ]; then
                echo "Creating "$i"..."
                $DEBUG ln -s "$DIR"/"$i" "$i"
        fi
done