PDA

View Full Version : UT2004 Linux Server map installation script


Loibisch
5th Sep 2004, 05:57 PM
Hey folks,

This script is pretty old, and so is this text. I originally posted this over at unrealadmin.org about a year ago (back then for UT2003)...I'm not sure why I never mentioned it here, only came to me when I recently updated that old post with some new links...maybe this will be useful for some of you :).

Thing is I got fed up with uploading huge uncompressed files using ftp/scp or uploading an archive with maps which I had to extract manually then (paying attention to .utx, .uax, etc.)
So I decided to write a small UT2003/UT2004 server map installation script for Linux.


Features:
Automatic installation of server content from archives
The script can extract server content (.ukx .ka .ut2 .uax .usx .u .int .utx) from various archive types (.zip .tar.gz .tar.bz2) and move it to the appropriate directories.
.uz2 compresses server content
The script optionally .uz2 compresses server content and moves the compressed files to a local directory (useful for a local http server that handles redirection or for uploading them to another server easily).
Can handle a whole directory full of archives in one step
You can tell the script to for example process all .zip files in a specific directory, or just have it process all known archive types it can find at the specified path.
Option to either keep or delete "junk files" found in the archives
"junk files" are files like .txt or .jpg files (or any other "unknown" type) that are totally useless to a server. You can either have those leftovers moved to a junk directory or just have the script delete them right away.
Thorough log files
The script will create a log file of all actions taken which allows you to see which file was extracted from which archive (useful if you want to uninstall a map including all textures it came with).
Most options available on the command line
There's just a few very elemental things you absolutely HAVE to set in the file itself, all other things can be specified on the command line.

At all stages the script will tell you what it's currently doing.

Before first use you will have to open the script and modify the settings. Documentation is included in the script.

Examples:
./ut2003mi foo.zip --> processes foo.zip
./ut2003mi -d /foo/bar --> processes all .zip files in /foo/bar
./ut2003mi -bd /foo/bar --> processes all .tar.bz2 files in /foo/bar
./ut2003mi -bgzd /foo/bar --> processes all archive types in /foo/bar
./ut2003mi -bgzrjd /foo/bar --> processes all archive types in /foo/bar, uses compression (overrides setting in the script itself) and preserves junkfiles

Benefits:
- ease of use, duh :P

Drawbacks:
- The script will generate quite some load on your server due to decompressing and .uz2 compressing the content. It's recommended to run it off-peak hours only (technically that's no fault of the script, would be the same if you did it manually)
- The code might be a bit clumsy in some parts, bear with me it's my first shell script :)

Future plans:
- add direct ftp upload to external http redirection servers from within the script (if enough people request it)
- squash any bugs that might exist :)


This script can also be used to install game content for the UT2003/UT2004 Linux client. It was written for servers, but since you can disable the compression it works great for clients, too. The only downside is that ".ogg" files will be considered junk files. You can either change that yourself or tell me you need it so badly that I'll fix it in a future version :).

If you want to modify/enhance the script you are free to do so, just one request: please gimme a note :)

Download:
UT2003 Linux Content Installer v0.815 (http://members.clanci.net/loibisch/files/utmi/ut2003mi.zip)
UT2004 Linux Content Installer v0.820 (http://members.clanci.net/loibisch/files/utmi/ut2004mi.zip)

Comments on how to improve the code or suggestions for more features are always welcome :).

(original thread: http://www.unrealadmin.org/forums/showthread.php?t=4344)