Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Moves any UT2004 files to www folder for redirect hosting (tries to skip vanilla files)
compress_ut_file() {
f=$(basename $1)
if [ ! -d "$file" -a ! -f "/var/www/ut2004/${f}.uz2" ] && [ "$file" != "*" ]; then
./ucc-bin compress -nohomedir $1
mv "${1}.uz2" /var/www/ut2004/
fi
}
export -f compress_ut_file
cd ~/ut-server/System
find ~/ut-server/Maps/ ~/ut-server/Textures/ ~/ut-server/Animations/ ~/ut-server/Sounds/ ~/ut-server/StaticMeshes/ ~/ut-server/System/ -type f \( -name "*.ut2" -o -name "*.u" -o -name "*.ukx" -o -name "*.uax" -o -name "*.usx" -o -name "*.int" -o -name "*.utx" \) -mtime -365 -exec bash -c 'compress_ut_file "$@"' bash "{}" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment