21 lines
416 B
Bash
21 lines
416 B
Bash
#!/bin/bash
|
|
|
|
#init variable
|
|
VMSTAT=poff
|
|
|
|
# boucle pour poff uniquement.
|
|
# on affiche l'id et le statut, on controle si le statut =poff
|
|
# si oui on fait un resume sur l'id de la vm concerné
|
|
for l in $(onevm list -l ID,STAT --csv | sed -e "/ID/d");
|
|
|
|
do
|
|
echo $l
|
|
echo ${l%%,$VMSTAT}
|
|
onevm show ${l%%,$VMSTAT}
|
|
if [[ "$l" =~ "$VMSTAT" ]];
|
|
then
|
|
onevm resume ${l%%,$VMSTAT}
|
|
fi
|
|
done
|
|
exit 0
|