#!/bin/bash #Twiki to DokuWiki File Converter #Developed by Thomas Vachon #Licensed under the GPL: (http://www.gnu.org/licenses/gpl.txt) if [ -z "$1" ]; then echo "Usage: $0 TwikiNamespace" exit fi #Copy the files to your present directory (run this in the data directory of the doku desination) rsync -arv /var/lib/twiki/data/$1 . cd $1 rm *,v *.lock #Makes all the filenames lowercase (as it is a dokuwiki requirement) for f in *; do g=`expr "xxx$f" : 'xxx\(.*\)' | tr '[A-Z]' '[a-z]'` mv "$f" "$g" done cd ../ #make the namespace directory lowercase namespace=`echo $1 | tr '[:upper:]' '[:lower:]'` mv $1 $namespace ./twikiconverter $namespace/*.txt