From 8e5eebc7a9ad2e4a9cefc6929d5a01f4d91cc0af Mon Sep 17 00:00:00 2001 From: sys4 Date: Sat, 28 Aug 2021 00:43:13 +0200 Subject: [PATCH] =?UTF-8?q?Corrige=20script=20g=C3=A9n=C3=A9ration=20carte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- genmap.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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