diff --git a/genmap.sh b/genmap.sh index eea13fc..30f76b6 100755 --- a/genmap.sh +++ b/genmap.sh @@ -50,8 +50,9 @@ action() { [ ! -e "$serverpath/colors.txt" ] && error "$serverpath/colors.txt manquant" # Copie du dossier leaftest vers /tmp puis on l'exécute de là + local config="$serverpath/minetest/minetest.conf" local workdir=$(mktemp -d "/tmp/minetest-mapper.XXXXXXXXX") - local spawn=$(grep "static_spawnpoint" $config | tr -d " " | cut -f 2 -d "="); + local spawn=$(grep "static_spawnpoint" "$config" | tr -d " " | cut -f 2 -d "=" | cut -f 1 -d' '); local spawnx=$(cut -f 1 -d "," <<<$spawn) local spawnz=$(cut -f 3 -d "," <<<$spawn) local mapsize=12288 @@ -68,7 +69,8 @@ action() { $workdir/leaftest/mapper.sh "$world" $spawnx,$spawnz $mapsize # Copie de leaftest vers le dossier web distant normalement déjà monté - cp -aL $workdir/leaftest/www "$destination/$world_name" + rm -rf "$destination/$world_name" + cp -rL $workdir/leaftest/www "$destination/$world_name" popd rm -rf $workdir