diff options
author | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2018-05-27 18:32:24 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@open-infrastructure.net> | 2018-05-27 18:44:03 +0000 |
commit | 9dfb6f87d0696fbf1930eda7d1957f52f2551988 (patch) | |
tree | 2608c0c8607a1689c23bde67cf10be7cb8cb23ad /lib/container/restart | |
parent | Correcting typo in verbose option handling of container remove command. (diff) | |
download | compute-tools-9dfb6f87d0696fbf1930eda7d1957f52f2551988.tar.xz compute-tools-9dfb6f87d0696fbf1930eda7d1957f52f2551988.zip |
Adding 'ALL' as pseudo container name for container start, stop, restart, and remove commands to act on all available container respectivly.
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rwxr-xr-x | lib/container/restart | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/container/restart b/lib/container/restart index a507cc0..a22b970 100755 --- a/lib/container/restart +++ b/lib/container/restart @@ -27,6 +27,8 @@ MACHINES="/var/lib/machines" Parameters () { + OPTIONS_ALL="" + GETOPT_LONGOPTIONS="name:," GETOPT_OPTIONS="n:," @@ -74,6 +76,19 @@ then Usage fi +case "${NAME}" in + ALL) + NAMES="$(container list --format shell --started)" + + for NAME in ${NAMES} + do + container restart --name ${NAME} || true + done + + exit 0 + ;; +esac + if [ ! -e "${MACHINES}/${NAME}" ] then echo "'${NAME}': no such container" >&2 |