Just written this after having problems with my old one. It converts downloaded maps and other files in cache to the proper files so you don't need to redownload every time.
As you can see it is for UT99 but can easily be converted to UT2004.
Code:
#!/bin/bash
function moveit() {
echo $(mv $cachename$ext $utdir$1$realname 2>/dev/null ) 1>/dev/null 2>&1
if [ ! -f $utdir$1$realname ]; then echo $realname" move failed!"; echo "";fi
}
function close() {
rm cache.ini *.uxx 2>/dev/null
if [ -f $utdir"System/De.u" ]; then rm $utdir"System/De.u" ;fi # optional
if [ -f $utdir"System/de.u" ]; then rm $utdir"System/de.u" ;fi # optional
exit 0
}
# Need to change these 2 lines:
cachedir=$HOME/.loki/ut/Cache # change to your cache dir
utdir=/mnt/str1/ut/ # change to your UT dir, or where you want to move files to
ext=".uxx"
cd $cachedir
if [ ! -f cache.ini ]; then close; fi
for line in `cat cache.ini | sed '/\[Cache\]/d'`
do
realname=${line:33:${#line}-34}
cachename=${line:0:32}
if echo "$line" | grep .unr; then moveit "Maps/"
elif echo "$line" | grep .utx; then moveit "Textures/"
elif echo "$line" | grep .uax; then moveit "Sounds/"
elif echo "$line" | grep .umx; then moveit "Music/"
elif echo "$line" | grep .u; then moveit "System/"
else close
fi
done
close