mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-13 18:44:29 +05:00
fix: allow for any amount of whitespaces after config section in update manager
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -419,7 +419,7 @@ function patch_fluidd_update_manager() {
|
|||||||
|
|
||||||
patched="false"
|
patched="false"
|
||||||
for conf in ${moonraker_configs}; do
|
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
|
### add new line to conf if it doesn't end with one
|
||||||
[[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"
|
[[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ function patch_klipperscreen_update_manager() {
|
|||||||
moonraker_configs=$(find "${KLIPPER_CONFIG}" -type f -name "moonraker.conf" | sort)
|
moonraker_configs=$(find "${KLIPPER_CONFIG}" -type f -name "moonraker.conf" | sort)
|
||||||
|
|
||||||
for conf in ${moonraker_configs}; do
|
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
|
### add new line to conf if it doesn't end with one
|
||||||
[[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"
|
[[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"
|
||||||
|
|
||||||
|
|||||||
@@ -597,7 +597,7 @@ function patch_mainsail_update_manager() {
|
|||||||
|
|
||||||
patched="false"
|
patched="false"
|
||||||
for conf in ${moonraker_configs}; do
|
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
|
### add new line to conf if it doesn't end with one
|
||||||
[[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"
|
[[ $(tail -c1 "${conf}" | wc -l) -eq 0 ]] && echo "" >> "${conf}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user