InstallMaps – an easy way to download, extract, install and bzip multiple SRCDS maps on Linux
#!/bin/sh
echo ---------------------------
echo InstallMaps by Darkimmortal
echo ---------------------------
echo Paste map URLs to be downloaded here, type @ to begin downloading.
echo
mkdir -p /tmp/installmaps
cd /tmp/installmaps
read -d @ line
echo
echo
if [[ $line == *tf2maps* ]]
then
tff=" --wait=26"
fi
wget --no-clobber --content-disposition $tf --user-agent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3" --accept=bsp,rar,zip,bz2 ${line//&/\&}
echo
echo
echo --------------------------------------------------------------------------
echo
echo
echo Extracting any compressed maps...
for f in *.zip;do unzip -j "$f";done
for f in *.rar;do unrar e -ep "$f";done
bzip2 -d -v -f *.bz2
echo Removing any non-bsp files...
ls -Q | grep -v .bsp\"$ | xargs rm
echo Zipping all maps...
bzip2 -k -z -v *.bsp
bzip2 -k -z -v *.nav
echo Moving files to the correct folders...
mv -f *.bsp YOUR_SRCDS_INSTALLATION/tf/maps
mv -f *.nav YOUR_SRCDS_INSTALLATION/tf/maps
mv -f *.bz2 YOUR_SV_DOWNLOADURL/tf/maps
echo Clearing download directory...
rm -rf ./*
echo Done!
This simple bash script allows you to paste a bunch of URLs (one per line) leading to uncompressed .bsp maps, or maps compressed as .rar, .zip or .bz2. It will then extract these maps, bzip them and move them to your SRCDS maps folder and the bzipped copies to your sv_downloadurl maps folder.
Replace YOUR_SRCDS_INSTALLATION and YOUR_SV_DOWNLOADURL with the appropriate values for your system, add Rapidshare details if you want, then you’re good to go.
Prerequisites: wget, unzip, unrar, bzip2
Categories: /b/