scripts/mapper.sh

37 lines
834 B
Bash
Raw Normal View History

2016-06-18 15:48:18 +02:00
#!/bin/bash
#
# *NOTE* for first run, you have to do something like
#
# +---------------------------------------------+
# | ~ # touch /home/minetest/mapshots/daily.png |
# +---------------------------------------------+
#
# first.
set -e
MAPPERDIR="/home/minetest/tools/minetestmapper"
CDDIR="/var/www/files/mapshots"
PUSHDIR="/var/www/files/mapshots/"
SOURCEDIR="/var/minetest/illuna_world"
MAIN="$CDDIR/daily.png"
KLEIN="$CDDIR/daily_small.jpg"
TARFILE="$CDDIR/daily.tar.bz2"
DATE=$(date "+%d-%m-%Y")
PORT="501"
cd $CDDIR
cp -r $MAIN $CDDIR/world_$DATE.png
rm -r $MAIN
cd $MAPPERDIR
./minetestmapper --geometry -10000:-5000+20000+20000 --bgcolor '#c7c7c7' --drawalpha --drawscale -i $SOURCEDIR -o $MAIN
cd $CDDIR
mogrify -resize 1000 -format jpg -quality 100 $MAIN
mv daily.jpg daily_small.jpg
tar -cvjf $TARFILE daily.png