fix: make patch_mobileraker_update_manager function work

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
th33xitus
2023-06-17 19:25:43 +02:00
parent ee27ccbf7b
commit c5dea3f36e

View File

@@ -211,10 +211,11 @@ function compare_mobileraker_versions() {
#================================================# #================================================#
function patch_mobileraker_update_manager() { function patch_mobileraker_update_manager() {
local patched="false" local patched moonraker_configs regex
local moonraker_configs regex="${HOME//\//\\/}\/([A-Za-z0-9_]+)\/config\/moonraker\.conf"
moonraker_configs=$(find "${KLIPPER_CONFIG}" -type f -name "moonraker.conf" | sort) moonraker_configs=$(find "${HOME}" -maxdepth 3 -type f -regextype posix-extended -regex "${regex}" | sort)
patched="false"
for conf in ${moonraker_configs}; do for conf in ${moonraker_configs}; do
if ! grep -Eq "^\[update_manager mobileraker\]\s*$" "${conf}"; then if ! grep -Eq "^\[update_manager mobileraker\]\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