From 52e7895c39a4c047b8ad27b9747cc365b9eaaa4e Mon Sep 17 00:00:00 2001 From: th33xitus Date: Sat, 28 May 2022 23:35:30 +0200 Subject: [PATCH] fix(moonraker-telegram-bot.sh): fix regex pattern Signed-off-by: Dominik Willner th33xitus@gmail.com --- scripts/moonraker-telegram-bot.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/moonraker-telegram-bot.sh b/scripts/moonraker-telegram-bot.sh index c3c1014..9943e83 100644 --- a/scripts/moonraker-telegram-bot.sh +++ b/scripts/moonraker-telegram-bot.sh @@ -17,7 +17,7 @@ set -e function telegram_bot_systemd() { local services - services=$(find "${SYSTEMD}" -maxdepth 1 -regextype posix-extended -regex "${SYSTEMD}/moonraker-telegram-bot(-[^0])?[0-9]*.service" | sort) + services=$(find "${SYSTEMD}" -maxdepth 1 -regextype posix-extended -regex "${SYSTEMD}/moonraker-telegram-bot(-[0-9a-zA-Z]+)?.service" | sort) echo "${services}" } @@ -344,8 +344,8 @@ function remove_telegram_bot_env() { } function remove_telegram_bot_logs() { - local files - files=$(find "${KLIPPER_LOGS}" -maxdepth 1 -regextype posix-extended -regex "${KLIPPER_LOGS}/telegram(-[0-9a-zA-Z]+)?\.log(.*)?" | sort) + local files regex="telegram(-[0-9a-zA-Z]+)?\.log(.*)?" + files=$(find "${KLIPPER_LOGS}" -maxdepth 1 -regextype posix-extended -regex "${KLIPPER_LOGS}/${regex}" | sort) if [[ -n ${files} ]]; then for file in ${files}; do