1
0

balance-containers: ne pas démarrer le conteneur si il était éteint

This commit is contained in:
pulsar89.5 2021-07-17 22:00:38 +02:00
parent a94f204647
commit f5fef01a0c

View File

@ -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