fix: always use system home directory (#303)

This commit is contained in:
Pedro Lamas
2023-02-28 14:30:42 +00:00
committed by GitHub
parent fd27db28d4
commit e3ed223b5c
8 changed files with 18 additions and 18 deletions

View File

@@ -311,7 +311,7 @@ function remove_moonraker_obico_systemd() {
}
function remove_moonraker_obico_logs() {
local files regex="\/home\/${USER}\/([A-Za-z0-9_]+)\/logs\/moonraker-obico(-[0-9a-zA-Z]+)?\.log(.*)?"
local files regex="${HOME//\//\\/}\/([A-Za-z0-9_]+)\/logs\/moonraker-obico(-[0-9a-zA-Z]+)?\.log(.*)?"
files=$(find "${HOME}" -maxdepth 3 -regextype posix-extended -regex "${regex}" | sort)
if [[ -n ${files} ]]; then