From ce45ac5c7264d24893d5aab4cbccadb065fd9fda Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 28 Feb 2021 17:50:23 +0100 Subject: [PATCH] Update scripts to make mapserver function properly the first time --- scripts/common.sh | 5 ++++- scripts/restart.sh | 4 ++-- scripts/start.sh | 4 ++-- scripts/stop.sh | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/common.sh b/scripts/common.sh index a6941f4..73fc5f2 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -68,9 +68,12 @@ function run_in_screen { } function start_mapserver { - echo -n "Starting Mapserver... " + echo -n "Starting mapserver... " if ! mapserver_running; then cd worlds/creative + while ! [ -f map.sqlite ]; do + sleep 0.1 + done run_in_screen `mapserver_screenname` `mapserver_lock` "./mapserver-linux-x86_64" cd ../.. echo -e "\e[32mDone\e[0m" diff --git a/scripts/restart.sh b/scripts/restart.sh index c83f46d..ae6ee4b 100755 --- a/scripts/restart.sh +++ b/scripts/restart.sh @@ -6,9 +6,9 @@ source scripts/common.sh case $1 in "--all") - restart_mapserver - restart_multiserver loop_worlds restart_world + restart_multiserver + restart_mapserver ;; "--worlds") loop_worlds restart_world diff --git a/scripts/start.sh b/scripts/start.sh index 961581c..720692a 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -6,9 +6,9 @@ source scripts/common.sh case $1 in "--all") - start_mapserver - start_multiserver loop_worlds start_world + start_multiserver + start_mapserver ;; "--worlds") loop_worlds start_world diff --git a/scripts/stop.sh b/scripts/stop.sh index d8493bf..e83300e 100755 --- a/scripts/stop.sh +++ b/scripts/stop.sh @@ -6,9 +6,9 @@ source scripts/common.sh case $1 in "--all") - stop_mapserver - stop_multiserver loop_worlds stop_world + stop_multiserver + stop_mapserver ;; "--worlds") loop_worlds stop_world -- 2.44.0