Skip to content

Instantly share code, notes, and snippets.

@skulumani
Last active March 7, 2021 23:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skulumani/1f1b88ec65f365a6b4d619530dfed9a5 to your computer and use it in GitHub Desktop.
Save skulumani/1f1b88ec65f365a6b4d619530dfed9a5 to your computer and use it in GitHub Desktop.
CID Insurgency map download

This script will download all the maps for the CID insurgency servers.

The map pack is given here:

http://www.cidclan.net/showthread.php?13549-Insurgency-CiD-Map-Pack

And the servers are found here:

Usage

Download the script below and execute:

wget https://gist.githubusercontent.com/skulumani/1f1b88ec65f365a6b4d619530dfed9a5/raw/4e4e9c047449d3bf0c1aa9e5716a7a5f0b8da8d0/insurgency_cid_download.sh

bash ./insurgency_cid_download.sh

This will prompt you for the path to your Steam install of Insurgency. The script will then download all the maps, extract the files, and copy them to the appropriate directory.

Tested on XUbuntu 18.04

#!/bin/bash
# download the maps for the insurgency CID servers
# http://www.cidclan.net/showthread.php?13549-Insurgency-CiD-Map-Pack
CID_MAP_PACK_URL="http://acedev.net/acedev/files/insurgency/maps/"
TEMP_DIR=$( mktemp -d )
if [[ ! "$TEMP_DIR" || ! -d "$TEMP_DIR" ]]; then
echo "Could not create temp dir"
exit 1
fi
# delete the temp directory on cleanup
function cleanup {
rm -rf "$TEMP_DIR"
echo "Deleted temp working directory $TEMP_DIR"
}
trap cleanup EXIT
# set path to Insurgency maps folder
echo " "
echo "Find your absolute insurgency maps path -> something like"
echo "/path/to/SteamLibrary/steamapps/common/insurgency2/insurgency/maps/"
echo " "
while read -ep "Enter absolute path: " file_dir; do
if [ -d "${file_dir}" ]; then
echo "${file_dir} exists - checking for default map buhriz.bsp"
echo " "
if [ ! -f "${file_dir}/buhriz.bsp" ]; then
echo "buhriz.bsp not found. Enter different directory"
echo " "
else
echo "buhriz.bsp found. This is probably a correct directory"
echo " "
INSURGENCY_MAPS_DIR=${file_dir}
break
fi
else
echo "${file_dir} doesn't exist"
echo "Try again"
echo " "
fi
done
# use wget to download all to /tmp
echo "Now downloading all maps to:\n${TEMP_DIR}\n"
cd ${TEMP_DIR}
wget --recursive --no-parent -nH --cut-dirs=4 --reject="index.html*" -q --show-progress ${CID_MAP_PACK_URL}
# extract all the bz2 files
echo " "
echo "Extracting all the maps"
bzip2 -d *.bz2
echo " "
echo "Copying all the maps to ${INSURGENCY_MAPS_DIR}"
cp --no-clobber * ${INSURGENCY_MAPS_DIR}
cd /tmp
echo " "
echo "Finished!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment