From 7dfe57e6da153662dd013979aae7e8eb093ea2a0 Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sat, 15 Oct 2022 02:43:00 +0200 Subject: [PATCH] Update demo_stop.sh --- demo_stop.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/demo_stop.sh b/demo_stop.sh index 227cc15..d4dd1e5 100755 --- a/demo_stop.sh +++ b/demo_stop.sh @@ -29,13 +29,19 @@ else fi ynh_print_info --message="> Arrêt des conteneurs" -if ! ynh_lxc_is_stopped --name=$lxc_name1 +if ynh_lxc_exists --name=$lxc_name1 then - ynh_print_info --message="Arrêt du conteneur $lxc_name1" - ynh_lxc_stop_as_demo --name=$lxc_name1 + if ! ynh_lxc_is_stopped --name=$lxc_name1 + then + ynh_print_info --message="Arrêt du conteneur $lxc_name1" + ynh_lxc_stop_as_demo --name=$lxc_name1 + fi fi -if ! ynh_lxc_is_stopped --name=$lxc_name2 +if ynh_lxc_exists --name=$lxc_name2 then - ynh_print_info --message="Arrêt du conteneur $lxc_name2" - ynh_lxc_stop_as_demo --name=$lxc_name2 + if ! ynh_lxc_is_stopped --name=$lxc_name2 + then + ynh_print_info --message="Arrêt du conteneur $lxc_name2" + ynh_lxc_stop_as_demo --name=$lxc_name2 + fi fi