You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
679 B

#!/bin/bash
# lxc-start.sh
# Fonction: Démarrer tout les conteneurs
# Auteur initial: Vivek Gite <www.cyberciti.biz>, under GPL v2+
# -------------------------------------------------------
# Obtenir la liste des conteneurs
vms="$(lxc-ls)"
# Démarrer tout les conteneurs de la liste
start_lxc(){
local vm="$1"
echo -e "\\033[1;34m*** [VM: $vm [$(hostname) @ $(date)] ] ***"
echo -e "\\033[1;32m-----------------------------------------------------------------"
tput sgr0
/usr/bin/lxc-start -n "$vm" -d
echo -e "\\033[1;32m-----------------------------------------------------------------"
tput sgr0
}
# Exécuter l'allumage
for v in $vms
do
start_lxc "$v"
done