diff --git a/scripts/fluidd.sh b/scripts/fluidd.sh index ff6f1f6..d363f15 100644 --- a/scripts/fluidd.sh +++ b/scripts/fluidd.sh @@ -399,10 +399,10 @@ function select_fluidd_port() { function patch_fluidd_update_manager() { local moonraker_configs - moonraker_configs=$(find "$(get_klipper_cfg_dir)" -type f -name "moonraker.conf" | sort) + moonraker_configs=$(find "${KLIPPER_CONFIG}" -type f -name "moonraker.conf" | sort) for conf in ${moonraker_configs}; do - if ! grep -Eq "[update_manager fluidd]" "${conf}"; then + if ! grep -Eq "^\[update_manager fluidd\]$" "${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 f49856b..5809389 100644 --- a/scripts/klipperscreen.sh +++ b/scripts/klipperscreen.sh @@ -201,10 +201,10 @@ function compare_klipperscreen_versions() { function patch_klipperscreen_update_manager() { local moonraker_configs - moonraker_configs=$(find "$(get_klipper_cfg_dir)" -type f -name "moonraker.conf" | sort) + 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\]$" "${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 6fe2a7f..7a6e035 100644 --- a/scripts/mainsail.sh +++ b/scripts/mainsail.sh @@ -527,10 +527,10 @@ function enable_mainsail_remotemode() { function patch_mainsail_update_manager() { local moonraker_configs - moonraker_configs=$(find "$(get_klipper_cfg_dir)" -type f -name "moonraker.conf" | sort) + moonraker_configs=$(find "${KLIPPER_CONFIG}" -type f -name "moonraker.conf" | sort) for conf in ${moonraker_configs}; do - if ! grep -Eq "[update_manager mainsail]" "${conf}"; then + if ! grep -Eq "^\[update_manager mainsail\]$" "${conf}"; then ### add new line to conf if it doesn't end with one [[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"