From 6116fc92cf2b833d6956363a8a3d65cd780c4acf Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sun, 30 Oct 2022 18:27:13 +0100 Subject: [PATCH] fix: allow for any amount of whitespaces after config section in update manager Signed-off-by: Dominik Willner --- scripts/fluidd.sh | 2 +- scripts/klipperscreen.sh | 2 +- scripts/mainsail.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/fluidd.sh b/scripts/fluidd.sh index 1277989..55f2e2e 100644 --- a/scripts/fluidd.sh +++ b/scripts/fluidd.sh @@ -419,7 +419,7 @@ function patch_fluidd_update_manager() { patched="false" for conf in ${moonraker_configs}; do - if ! grep -Eq "^\[update_manager fluidd\]$" "${conf}"; then + if ! grep -Eq "^\[update_manager fluidd\]\s*$" "${conf}"; then ### add new line to conf if it doesn't end with one [[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}" diff --git a/scripts/klipperscreen.sh b/scripts/klipperscreen.sh index 945f98b..7c302fe 100644 --- a/scripts/klipperscreen.sh +++ b/scripts/klipperscreen.sh @@ -207,7 +207,7 @@ function patch_klipperscreen_update_manager() { moonraker_configs=$(find "${KLIPPER_CONFIG}" -type f -name "moonraker.conf" | sort) for conf in ${moonraker_configs}; do - if ! grep -Eq "^\[update_manager KlipperScreen\]$" "${conf}"; then + if ! grep -Eq "^\[update_manager KlipperScreen\]\s*$" "${conf}"; then ### add new line to conf if it doesn't end with one [[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}" diff --git a/scripts/mainsail.sh b/scripts/mainsail.sh index b3310ed..b3c1f95 100644 --- a/scripts/mainsail.sh +++ b/scripts/mainsail.sh @@ -597,7 +597,7 @@ function patch_mainsail_update_manager() { patched="false" for conf in ${moonraker_configs}; do - if ! grep -Eq "^\[update_manager mainsail\]$" "${conf}"; then + if ! grep -Eq "^\[update_manager mainsail\]\s*$" "${conf}"; then ### add new line to conf if it doesn't end with one [[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"