diff --git a/balance-containers/run.bash b/balance-containers/run.bash index 24f5f3c..fc9a0f5 100755 --- a/balance-containers/run.bash +++ b/balance-containers/run.bash @@ -35,9 +35,13 @@ move_ct() { [[ $? -eq 0 ]] && echo "success" || echo "failed" # Démarrer - echo -n " start: " - lxc start $ct 2> /dev/null - [[ $? -eq 0 ]] && echo "success" || echo "failed" + if [[ $(lxc list --columns s --format csv $ct 2> /dev/null) == "RUNNING" ]]; then + echo -n " start: " + lxc start $ct 2> /dev/null + [[ $? -eq 0 ]] && echo "success" || echo "failed" + else + echo " start: skipped" + fi } # Boucler sur les arguments