I had some problems with my old one - any maps with characters like ( or = in the file name would not copy. So I rewrote it from scratch and so far it seems ok.
Code:
#!/bin/bash
function moveit() {
echo $(cp $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
Don't forget to chmod +x it.
It is fairly straight forward to convert to UT2004 but if you need help with that, let me know.
Last edited by ~V~ on Mar 17, 2006 - 01:33 AM; edited 3 times in total
#!/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 tempcache tmp cache.ini *.uxx 2>/dev/null
if [ -f $utdir"System/den_p1p0-Hack.u" ]; then rm $utdir"System/den_p1p0-Hack.u" ;fi
exit 0
}
# Need to change this line:
utdir=/mnt/str4/ut2004/ # change to your UT dir, or where you want to save files
cachedir=$HOME/.ut2004/Cache
ext=".uxx"
cd $cachedir
if [ ! -f cache.ini ]; then close; fi
for line in `cat cache.ini | sed '/\[Cache\]/d'`
do
realname=${line:35:${#line}-34}
cachename=${line:0:34}
if echo "$line" | grep .ut2; then moveit "Maps/"
elif echo "$line" | grep .utx; then moveit "Textures/"
elif echo "$line" | grep .uax; then moveit "Sounds/"
elif echo "$line" | grep .ogg; then moveit "Music/"
elif echo "$line" | grep .usx; then moveit "StaticMeshes/"
elif echo "$line" | grep .ukx; then moveit "Animations/"
elif echo "$line" | grep .u; then moveit "System/"
else close
fi
done
close
Great stuff, V. Now if we could get a demo manager and chatlogger for linux, we'd be closer to being like "them" in regards to what you can do in linux. Thanks for posting this, and thanks for all your help for the NIXUT community.