From 2ebbdc4d84c155627838b38868612c14d638335a Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 4 Apr 2025 17:37:07 +0200 Subject: [PATCH] fix msg --- update-incus-container.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/update-incus-container.sh b/update-incus-container.sh index 73fb208..68c9d95 100755 --- a/update-incus-container.sh +++ b/update-incus-container.sh @@ -10,8 +10,8 @@ TMSTMP=$(date +'%Y%m%d%H%M%S') function stop_container() { echo $(date) "- ${BGreen}Stop container ${1}${Color_Off}" - incus stop ${1} | sed "s/^/$(date) - ${BGreen}${1}${Color_Off} /" - wait + incus stop ${1} | sed "s/^/$(date) - ${BGreen}${1}${Color_Off} /" + wait echo -e $(date) "- ${BGreen}Container ${1} stopped${Color_Off}" } @@ -22,11 +22,11 @@ function update_container() { sleep 2 incus exec ${1} -- sh -c "apt autoremove -y 2>&1" | sed "s/^/$(date) - ${BGreen}${1}${Color_Off} /" sleep 2 - echo -e $(date) "- ${BGreen}Refresh snap packages${Color_Off}" + echo -e $(date) "- ${BGreen}Refresh snap packages for ${1} container...${Color_Off}" incus exec ${1} -- bash -c "if [[ \$(which snap > /dev/null; echo \$?) == 0 ]]; then snap refresh ; fi" | sed "s/^/$(date) - ${BGreen}${1}${Color_Off} /" if [ "${2}" == "STOPPED" ]; then stop_container ${1} - fi + fi } echo $(date) "- ${BGreen}Start updating incus container...${Color_Off}"