fix(moonraker.sh): silence error, refactor regex

Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
th33xitus
2022-05-17 18:45:44 +02:00
parent 29d23951b2
commit 0f859aafca

View File

@@ -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