Skip to content

Instantly share code, notes, and snippets.

@apathyboy
Created November 15, 2010 12:19
Show Gist options
  • Save apathyboy/700298 to your computer and use it in GitHub Desktop.
Save apathyboy/700298 to your computer and use it in GitHub Desktop.
Downloads all the resources necessary to run an instance of the swganh mmoserver on a unix environment.
#!/bin/bash
basedir=$(cd $(dirname $0) && pwd)
# make the heightmaps directory if it doesn't exist
if [ ! -d $basedir/heightmaps ]; then
mkdir $basedir/heightmaps
fi
planets=("corellia"
"dantooine"
"dathomir"
"endor"
"lok"
"naboo"
"rori"
"talus"
"tatooine"
"yavin4")
elements=${#planets[@]}
# for each planet in the above array make sure the heightmap exists, if not
# download it and unpack it.
for (( i=0;i<$elements;i++ )); do
planet=${planets[${i}]}
if [ -f $basedir/heightmaps/$planet.hmpw ]; then
continue
fi
wget -nc --no-check-certificate https://github.com/downloads/anhstudios/swg-heightmaps/$planet.hmpw.7z -O heightmaps/$planet.hmpw.7z
7za e $basedir/heightmaps/$planet.hmpw.7z -o$basedir/heightmaps
done
# download the default configs
if [ ! -d $basedir/config ]; then
git clone git://github.com/apathyboy/precu-configs.git $basedir/config
fi
# download the default precu script pack
if [ ! -d $basedir/script ]; then
git clone git://github.com/apathyboy/precu-scripts.git $basedir/script
fi
# create the directory for the logs if it doesn't exist
if [ ! -d $basedir/logs ]; then
mkdir $basedir/logs
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment