From 0f859aafca6279f5ee93c0fb6cd6bc11fb41ea94 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Tue, 17 May 2022 18:45:44 +0200 Subject: [PATCH] fix(moonraker.sh): silence error, refactor regex Signed-off-by: Dominik Willner th33xitus@gmail.com --- scripts/moonraker.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/moonraker.sh b/scripts/moonraker.sh index 98bf4d8..0e2ec5f 100644 --- a/scripts/moonraker.sh +++ b/scripts/moonraker.sh @@ -392,8 +392,8 @@ function remove_moonraker_systemd() { } function remove_moonraker_logs() { - local files - files=$(find "${KLIPPER_LOGS}" -maxdepth 1 -regextype posix-extended -regex "${KLIPPER_LOGS}/moonraker(-[0-9a-zA-Z]+)?\.log(.*)?" | sort) + local files regex="moonraker(-[0-9a-zA-Z]+)?\.log(.*)?" + files=$(find "${KLIPPER_LOGS}" -maxdepth 1 -regextype posix-extended -regex "${KLIPPER_LOGS}/${regex}" 2> /dev/null | sort) if [[ -n ${files} ]]; then for file in ${files}; do