fix: fix method to remove all env and log files

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
th33xitus
2022-10-16 14:24:15 +02:00
parent 423bdd4654
commit cf05354c7b
2 changed files with 8 additions and 8 deletions

View File

@@ -465,8 +465,8 @@ function remove_moonraker_systemd() {
}
function remove_moonraker_env_file() {
local files regex="moonraker.env"
files=$(find "${PRINTER_DATA}" -maxdepth 2 -regextype posix-extended -regex "${PRINTER_DATA}/.*/${regex}" 2> /dev/null | sort)
local files name="moonraker.env"
files=$(find "${PRINTER_DATA}" -name "${name}" 2> /dev/null | sort)
if [[ -n ${files} ]]; then
for file in ${files}; do
@@ -478,8 +478,8 @@ function remove_moonraker_env_file() {
}
function remove_moonraker_logs() {
local files regex="moonraker.log(.*)?"
files=$(find "${PRINTER_DATA}" -maxdepth 2 -regextype posix-extended -regex "${PRINTER_DATA}/.*/${regex}" 2> /dev/null | sort)
local files name="moonraker.log*"
files=$(find "${PRINTER_DATA}" -name "${name}" 2> /dev/null | sort)
if [[ -n ${files} ]]; then
for file in ${files}; do