fix Status of container for each versions of LXD

This commit is contained in:
Kay0u 2022-08-10 18:59:24 +02:00
parent 0c9a1b24bc
commit 3b23a02709
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

View file

@ -118,7 +118,7 @@ rotate_image()
local should_restart=0
# If the container is running, stop it
if [ $(lxc info $instance_to_publish | grep Status | awk '{print $2}') = "RUNNING" ]
if [ "$(lxc info $instance_to_publish | grep Status | awk '{print tolower($2)}')" = "running" ]
then
should_restart=1
lxc stop "$instance_to_publish"