Blame Identity/Models/Html/Moin/install.sh

d6e8d8
#!/bin/bash
d6e8d8
#
d6e8d8
#
d6e8d8
d6e8d8
d6e8d8
# Export directory name.
d6e8d8
EXPORTDIR=tmp
d6e8d8
WIKILOCATION=/var/www
d6e8d8
d6e8d8
# Instance Name which you want apply this theme to.
d6e8d8
printf 'Site instance: '
d6e8d8
read WIKIINSTANCE
d6e8d8
if [ ! -d "${WIKILOCATION}/${WIKIINSTANCE}" ];then
d6e8d8
	echo "The instance '${WIKIINSTANCE}' does not exist."
d6e8d8
	exit;
d6e8d8
fi
d6e8d8
d6e8d8
# Customized version selector
d6e8d8
echo 'Site customization:'
d6e8d8
select VERSION in `find . -maxdepth 1 -type d \
d6e8d8
	| egrep -v '^.$' | egrep -v 'svn' \
d6e8d8
	| sed 's/\.\///'`;do
d6e8d8
	# SVN Repository directory
d6e8d8
	SVN=http://centos.org/svn/artwork/trunk/Extras/Moin/$VERSION
d6e8d8
	break
d6e8d8
done
d6e8d8
d6e8d8
d6e8d8
# Location where your wiki instance is stored.
d6e8d8
WIKILOCATION=/var/www/
d6e8d8
d6e8d8
# Define Theme Name.
d6e8d8
THEMENAME="Modern"
d6e8d8
d6e8d8
# Create instance
d6e8d8
echo 'Downloading customization ...'
d6e8d8
mkdir $EXPORTDIR
d6e8d8
svn export $SVN/ $EXPORTDIR/ --force --quiet
d6e8d8
d6e8d8
echo 'Applying customization ...'
d6e8d8
cp -r $EXPORTDIR/$THEMENAME ${WIKILOCATION}${WIKIINSTANCE}/htdocs/
d6e8d8
cp $EXPORTDIR/${THEMENAME}.py ${WIKILOCATION}${WIKIINSTANCE}/data/plugin/theme/${THEMENAME}.py
d6e8d8
cp logo.png ${WIKILOCATION}${WIKIINSTANCE}/htdocs/common/logo.png
d6e8d8
rm -r $EXPORTDIR
d6e8d8
d6e8d8
# Modify wikiconfig.py to set theme personalized names.
d6e8d8
sed -i -e "
d6e8d8
	/logo_string =/{
d6e8d8
	c\\
d6e8d8
    logo_string = u'\"CentOS\"'
d6e8d8
	}
d6e8d8
	/theme_default =/{
d6e8d8
	c\\
d6e8d8
    theme_default = '${THEMENAME}'
d6e8d8
	}
d6e8d8
	" ${WIKILOCATION}${WIKIINSTANCE}/cgi-bin/*.py
d6e8d8
d6e8d8
# Set Permissions
d6e8d8
echo 'Updating permissions ... '
d6e8d8
chown -R apache.apache ${WIKILOCATION}${WIKIINSTANCE}/htdocs/${THEMENAME}/
d6e8d8
chown -R apache.apache ${WIKILOCATION}${WIKIINSTANCE}/data/plugin/theme/${THEMENAME}.py
d6e8d8
chown -R apache.apache ${WIKILOCATION}${WIKIINSTANCE}/htdocs/common/logo.png
d6e8d8
chmod -R 750 ${WIKILOCATION}${WIKIINSTANCE}/htdocs/${THEMENAME}/
d6e8d8
chmod -R 750 ${WIKILOCATION}${WIKIINSTANCE}/data/plugin/theme/${THEMENAME}.py
d6e8d8
chmod -R 750 ${WIKILOCATION}${WIKIINSTANCE}/htdocs/common/logo.png