| #!/bin/bash |
| |
| |
| |
| |
| |
| EXPORTDIR=tmp |
| WIKILOCATION=/var/www |
| |
| |
| printf 'Site instance: ' |
| read WIKIINSTANCE |
| if [ ! -d "${WIKILOCATION}/${WIKIINSTANCE}" ];then |
| echo "The instance '${WIKIINSTANCE}' does not exist." |
| exit; |
| fi |
| |
| |
| echo 'Site customization:' |
| select VERSION in `find . -maxdepth 1 -type d \ |
| | egrep -v '^.$' | egrep -v 'svn' \ |
| | sed 's/\.\///'`;do |
| |
| SVN=http://centos.org/svn/artwork/trunk/Extras/Moin/$VERSION |
| break |
| done |
| |
| |
| |
| WIKILOCATION=/var/www/ |
| |
| |
| THEMENAME="Modern" |
| |
| |
| echo 'Downloading customization ...' |
| mkdir $EXPORTDIR |
| svn export $SVN/ $EXPORTDIR/ --force --quiet |
| |
| echo 'Applying customization ...' |
| cp -r $EXPORTDIR/$THEMENAME ${WIKILOCATION}${WIKIINSTANCE}/htdocs/ |
| cp $EXPORTDIR/${THEMENAME}.py ${WIKILOCATION}${WIKIINSTANCE}/data/plugin/theme/${THEMENAME}.py |
| cp logo.png ${WIKILOCATION}${WIKIINSTANCE}/htdocs/common/logo.png |
| rm -r $EXPORTDIR |
| |
| |
| sed -i -e " |
| /logo_string =/{ |
| c\\ |
| logo_string = u'<img src=\"/${WIKIINSTANCE}_staticfiles/common/logo.png\" alt=\"CentOS\">' |
| } |
| /theme_default =/{ |
| c\\ |
| theme_default = '${THEMENAME}' |
| } |
| " ${WIKILOCATION}${WIKIINSTANCE}/cgi-bin/*.py |
| |
| |
| echo 'Updating permissions ... ' |
| chown -R apache.apache ${WIKILOCATION}${WIKIINSTANCE}/htdocs/${THEMENAME}/ |
| chown -R apache.apache ${WIKILOCATION}${WIKIINSTANCE}/data/plugin/theme/${THEMENAME}.py |
| chown -R apache.apache ${WIKILOCATION}${WIKIINSTANCE}/htdocs/common/logo.png |
| chmod -R 750 ${WIKILOCATION}${WIKIINSTANCE}/htdocs/${THEMENAME}/ |
| chmod -R 750 ${WIKILOCATION}${WIKIINSTANCE}/data/plugin/theme/${THEMENAME}.py |
| chmod -R 750 ${WIKILOCATION}${WIKIINSTANCE}/htdocs/common/logo.png |