Created
April 27, 2011 15:26
-
-
Save florianbeisel/944469 to your computer and use it in GitHub Desktop.
Script for updating Pigmap - with multiworld support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
declare -a worlds=(firstworld Netherworld thirdworld) | |
numworlds=${#worlds[@]} | |
if [ "$(ps aux|egrep -v 'grep|pigmap.sh'|egrep 'python|rsync|pigmap')" ] | |
then | |
echo Running process found exiting | |
exit 0 | |
else | |
echo "Starting Update" | |
cd /home/minecraft/pigmap | |
sh ../scripts/server.sh stopsave | |
for ((i=0;i<$numworlds;i++)); do | |
rsync -vur --delete ../server/${worlds[$i]}/ maps/${worlds[$i]} > ${worlds[$i]}.chunklist | |
done | |
sh ../scripts/server.sh startsave | |
for ((i=0;i<$numworlds;i++)); do | |
nice 19 ./pigmap -i maps/${worlds[$i]} -g images -o output/${worlds[$i]} -r ${worlds[$i]}.chunklist -h 2 -x | |
done | |
fi | |
date | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment