From 34fb023df4164ece04d6b2a9aa6ba4ae90c83a3c Mon Sep 17 00:00:00 2001 From: Sam Heinz <54530346+asylumexp@users.noreply.github.com> Date: Thu, 8 Aug 2024 07:04:36 +1000 Subject: [PATCH] Handle frigate CT stopped gracefully Should close #64 --- ct/frigate.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ct/frigate.sh b/ct/frigate.sh index dbb1b137f..0aeac7057 100644 --- a/ct/frigate.sh +++ b/ct/frigate.sh @@ -64,8 +64,13 @@ build_container description msg_info "Setting Container to Normal Resources" -pct set $CTID -memory 1024 -msg_ok "Set Container to Normal Resources" +STATUS=$(pct status $CTID | grep -oP '(?<=status: ).*') +if [ "$STATUS" == "running" ]; then + pct set $CTID -memory 1024 +else + echo -e " ⚠️ ${RD}Container is not running. Will need to change memory to 1024MB manually.${CL}" +fi +msg_ok "Set Normal Resources" msg_ok "Completed Successfully!\n" echo -e "${APP} should be reachable by going to the following URL. ${BL}http://${IP}:5000${CL} \n"