]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
testing: Ignore hosts that are not running during shutdown
authorTobias Brunner <tobias@strongswan.org>
Tue, 6 Oct 2020 13:31:14 +0000 (15:31 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 29 Oct 2020 09:22:51 +0000 (10:22 +0100)
This allows properly terminating the environment if a host has crashed
or was terminated manually for some reason.

testing/stop-testing

index 8abf5f223936558197cd143b58ac02a4d71d0970..6f705b8124cee43056b36310b53319041732968c 100755 (executable)
@@ -24,7 +24,12 @@ done
 for host in $STRONGSWANHOSTS
 do
        log_action "Guest $host"
-       execute "virsh shutdown $host"
+
+       if running_any $host; then
+               execute "virsh shutdown $host"
+       else
+               echo_warn "...not running"
+       fi
        rm -f $VIRTIMGSTORE/$host.$IMGEXT
 done