From 0edb73fce62a1f962af7446df1c66531dfcdbeb8 Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Fri, 26 Jan 2024 14:29:48 -0500 Subject: [PATCH 1/7] Added fix for blank PalWorld Settings file --- README.md | 3 --- scripts/start.sh | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 0ea32b645..dc157c892 100644 --- a/README.md +++ b/README.md @@ -202,9 +202,6 @@ Please keep in mind that the ENV variables will always overwrite the changes mad For a more detailed list of explanations of server settings go to: [shockbyte](https://shockbyte.com/billing/knowledgebase/1189/How-to-Configure-your-Palworld-server.html) -> [!TIP] -> If the `/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini` is empty, -> delete the file and restart the server, a new file with content will be created. ## Reporting Issues/Feature Requests diff --git a/scripts/start.sh b/scripts/start.sh index 91590765e..278590fa5 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -46,7 +46,7 @@ cd /palworld || exit printf "\e[0;32m*****CHECKING FOR EXISTING CONFIG*****\e[0m\n" -if [ ! -f /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini ]; then +if [ ! -f /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini ] || [ -z $(grep '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini) ]; then printf "\e[0;32m*****GENERATING CONFIG*****\e[0m\n" From 1a21132721ea4fe1ed5f39ba5911335b6ccb03f7 Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Fri, 26 Jan 2024 14:40:47 -0500 Subject: [PATCH 2/7] Removed extra blank line --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index dc157c892..a94f093ab 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,6 @@ Please keep in mind that the ENV variables will always overwrite the changes mad For a more detailed list of explanations of server settings go to: [shockbyte](https://shockbyte.com/billing/knowledgebase/1189/How-to-Configure-your-Palworld-server.html) - ## Reporting Issues/Feature Requests Issues/Feature requests can be submitted by using [this link](https://github.com/thijsvanloef/palworld-server-docker/issues/new/choose). From f17ec1c56445ede2e74c9a26297068500ead2df0 Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Fri, 26 Jan 2024 14:47:20 -0500 Subject: [PATCH 3/7] Changed so grep sees if file exists --- scripts/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start.sh b/scripts/start.sh index 278590fa5..4cfafb667 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -46,7 +46,7 @@ cd /palworld || exit printf "\e[0;32m*****CHECKING FOR EXISTING CONFIG*****\e[0m\n" -if [ ! -f /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini ] || [ -z $(grep '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini) ]; then +if [ $(grep -qs '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini) ]; then printf "\e[0;32m*****GENERATING CONFIG*****\e[0m\n" From 9a44df1ae70908fcb423a9ee61f2eb8b441b376c Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Fri, 26 Jan 2024 15:38:41 -0500 Subject: [PATCH 4/7] Added quotes --- scripts/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start.sh b/scripts/start.sh index 4cfafb667..1c24880ee 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -46,7 +46,7 @@ cd /palworld || exit printf "\e[0;32m*****CHECKING FOR EXISTING CONFIG*****\e[0m\n" -if [ $(grep -qs '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini) ]; then +if [ ! "$(grep -s '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini)" ]; then printf "\e[0;32m*****GENERATING CONFIG*****\e[0m\n" From 2276c40afac74d7e4038580162cfffe6ad61c188 Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Fri, 26 Jan 2024 15:43:13 -0500 Subject: [PATCH 5/7] Seeing if spellcheck is happy (Always overwrite) --- scripts/start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/start.sh b/scripts/start.sh index 1c24880ee..feb9bc4df 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -46,7 +46,8 @@ cd /palworld || exit printf "\e[0;32m*****CHECKING FOR EXISTING CONFIG*****\e[0m\n" -if [ ! "$(grep -s '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini)" ]; then +# This will always overwrite +if [ ! "$(grep -sq '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini)" ]; then printf "\e[0;32m*****GENERATING CONFIG*****\e[0m\n" From a6f9a70fdec18ab46dbb778bd8311e8ed7364770 Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Fri, 26 Jan 2024 15:45:37 -0500 Subject: [PATCH 6/7] Moved grep outside if condition --- scripts/start.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index feb9bc4df..c70332698 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -46,8 +46,9 @@ cd /palworld || exit printf "\e[0;32m*****CHECKING FOR EXISTING CONFIG*****\e[0m\n" -# This will always overwrite -if [ ! "$(grep -sq '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini)" ]; then +# Check if PalWorldSettings.ini exists and it not blank +grep -s '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini +if [ ! $? ]; then printf "\e[0;32m*****GENERATING CONFIG*****\e[0m\n" From 3ff8d1a6f7f39bc65d575993a1f8a6a35492ceb4 Mon Sep 17 00:00:00 2001 From: "Carlos M. Martinez" Date: Fri, 26 Jan 2024 15:51:56 -0500 Subject: [PATCH 7/7] Added spellcheck exception --- scripts/start.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index c70332698..7bea41d67 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -46,9 +46,8 @@ cd /palworld || exit printf "\e[0;32m*****CHECKING FOR EXISTING CONFIG*****\e[0m\n" -# Check if PalWorldSettings.ini exists and it not blank -grep -s '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini -if [ ! $? ]; then +# shellcheck disable=SC2143 +if [ ! "$(grep -s '[^[:space:]]' /palworld/Pal/Saved/Config/LinuxServer/PalWorldSettings.ini)" ]; then printf "\e[0;32m*****GENERATING CONFIG*****\e[0m\n"