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