From faf56ed1b18008ccc410f8449ee02788b29f94e3 Mon Sep 17 00:00:00 2001 From: Stephan Wendel <43513802+KwadFan@users.noreply.github.com> Date: Tue, 28 Feb 2023 18:37:43 +0100 Subject: [PATCH] refactor(crowsnest): improve performance in crowsnest.sh (#306) --- scripts/crowsnest.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/crowsnest.sh b/scripts/crowsnest.sh index f8ed048..4733a29 100644 --- a/scripts/crowsnest.sh +++ b/scripts/crowsnest.sh @@ -134,15 +134,15 @@ function remove_crowsnest(){ # Status funcs get_crowsnest_status(){ local -a files + local env_file + env_file="$(grep "EnvironmentFile" /etc/systemd/system/crowsnest.service | cut -d "=" -f2)" files=( "${CROWSNEST_DIR}" "/usr/local/bin/crowsnest" "/etc/logrotate.d/crowsnest" "/etc/systemd/system/crowsnest.service" - "$(find "${HOME}" -name 'crowsnest.env' 2> /dev/null || - echo "${HOME}/printer_data/systemd/crowsnest.env")" + "${env_file}" ) - # Contains ugly hackaround for multi instance... :( local count count=0