homeserver/roles/mgrote.proxmox/templates/start_pools.sh
Michael Grote 9740c39dac Rolle: proxmox
Keine Fehlermeldung mehr wenn VMs schon laufen
2021-01-18 14:41:09 +01:00

8 lines
670 B
Bash

#! /bin/bash
{% raw %}
# starte/stoppe Container
sudo pvesh get /pools/$1 | sed -r 's#(,)#\n#g;s#\│##g;s#─##g;s#┴##g;s#└##g;s#┘##g;s#╞##g;s#╪##g;s#═##g;s#╡##g;s#\{##g;s#\}##g;s#\"*\"##g;s#\[##g;s#\]##g;s#id\:##g' | grep -E 'lxc/[[:digit:]]{3}' | sed -r 's#(lxc\/)([0-9]{3})#\2#g' | sudo xargs -i sh -c "pct "$2" {} || true"
# starte/stoppe VMs
sudo pvesh get /pools/$1 | sed -r 's#(,)#\n#g;s#\│##g;s#─##g;s#┴##g;s#└##g;s#┘##g;s#╞##g;s#╪##g;s#═##g;s#╡##g;s#\{##g;s#\}##g;s#\"*\"##g;s#\[##g;s#\]##g;s#id\:##g' | grep -E 'qemu/[[:digit:]]{3}' | sed -r 's#(qemu\/)([0-9]{3})#\2#g' | sudo xargs -i sh -c "qm "$2" {} || true"
{% endraw %}