fix Status of container for each versions of LXD

This commit is contained in:
Kay0u 2022-08-10 18:59:47 +02:00
parent afb0779650
commit 87022f9894
No known key found for this signature in database
GPG key ID: AAFEEB16CFA2AE2D

View file

@ -27,7 +27,7 @@ function 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"