Commit 092c06f0 authored by Vitaly Lipatov's avatar Vitaly Lipatov

evz-vboxmanage: rename containers to virtual machines

parent c1108b9b
...@@ -53,7 +53,7 @@ evz_vboxmanage() ...@@ -53,7 +53,7 @@ evz_vboxmanage()
CMD=$1 CMD=$1
shift shift
case $CMD in case $CMD in
off) # HELPCMD: stop container(s) and disable start on boot off) # HELPCMD: stop virtual machine(s) and disable start on boot
LIST="$(get_list "$@")" LIST="$(get_list "$@")"
for i in $LIST ; do for i in $LIST ; do
#info "Stopping $i ..." #info "Stopping $i ..."
...@@ -61,7 +61,7 @@ case $CMD in ...@@ -61,7 +61,7 @@ case $CMD in
todo docmd docker update --restart no $i todo docmd docker update --restart no $i
done done
;; ;;
on) # HELPCMD: enable start on boot and start container(s) on) # HELPCMD: enable start on boot and start virtual machine(s)
for i in "$@" ; do for i in "$@" ; do
#info "Starting $i ..." #info "Starting $i ..."
# TODO: check if enabled # TODO: check if enabled
...@@ -69,14 +69,14 @@ case $CMD in ...@@ -69,14 +69,14 @@ case $CMD in
todo docmd docker start $i todo docmd docker start $i
done done
;; ;;
status) # HELPCMD: print container(s) status status) # HELPCMD: print virtual machine(s) status
LIST="$(get_list "$@")" LIST="$(get_list "$@")"
#info "Do $CMD for $LIST ..." #info "Do $CMD for $LIST ..."
for i in $LIST ; do for i in $LIST ; do
todo docmd docker stats --no-stream --no-trunc $i todo docmd docker stats --no-stream --no-trunc $i
done done
;; ;;
compact) # HELPCMD: do named operation on container(s) compact) # HELPCMD: do named operation on virtual machine(s)
LIST="$(get_list "$@")" LIST="$(get_list "$@")"
for i in $LIST ; do for i in $LIST ; do
info "Do $CMD on $i ..." info "Do $CMD on $i ..."
...@@ -99,13 +99,13 @@ case $CMD in ...@@ -99,13 +99,13 @@ case $CMD in
todo vzctl $CMD $i $OPTIONS --save todo vzctl $CMD $i $OPTIONS --save
done done
;; ;;
ubc|resources|show) # HELPCMD: print resource using ubc|resources|show) # HELPCMD: print resource using by virtual machine(s)
LIST="$(get_list "$@")" LIST="$(get_list "$@")"
for i in $LIST ; do for i in $LIST ; do
docmd vboxmanage showvminfo $i docmd vboxmanage showvminfo $i
done done
;; ;;
stop) # HELPCMD: stop container(s) stop) # HELPCMD: stop virtual machine(s)
LIST="$(get_list "$@")" LIST="$(get_list "$@")"
for i in $LIST ; do for i in $LIST ; do
info "Stopping $i ..." info "Stopping $i ..."
...@@ -116,21 +116,21 @@ case $CMD in ...@@ -116,21 +116,21 @@ case $CMD in
docmd vboxmanage controlvm $i acpipowerbutton docmd vboxmanage controlvm $i acpipowerbutton
done done
;; ;;
start) # HELPCMD: start container(s) start) # HELPCMD: start virtual machine(s)
LIST="$(get_list "$@")" LIST="$(get_list "$@")"
for i in $LIST ; do for i in $LIST ; do
info "Starting $i ..." info "Starting $i ..."
docmd vboxmanage startvm --type headless $i docmd vboxmanage startvm --type headless $i
done done
;; ;;
restart) # HELPCMD: restart container(s) restart) # HELPCMD: restart virtual machine(s)
LIST="$(get_list "$@")" LIST="$(get_list "$@")"
for i in $LIST ; do for i in $LIST ; do
info "Restarting $i ..." info "Restarting $i ..."
todo docmd ker restart $i todo docmd ker restart $i
done done
;; ;;
list|ps) # HELPCMD: list available container(s) (use -q|-1 for list only ID, list -a for list ever stopped containers) list|ps) # HELPCMD: list available virtual machine(s) (use -q|-1 for list only ID, list -a for list ever stopped virtual machines)
# if -q, just id list # if -q, just id list
if [ -z "$verbose" ] || [ "$1" = "-1" ] || [ "$1" = "-q" ] ; then if [ -z "$verbose" ] || [ "$1" = "-1" ] || [ "$1" = "-q" ] ; then
[ -z "$verbose" ] || shift [ -z "$verbose" ] || shift
...@@ -143,7 +143,7 @@ case $CMD in ...@@ -143,7 +143,7 @@ case $CMD in
docmd vboxmanage list runningvms docmd vboxmanage list runningvms
fi fi
;; ;;
exec) # HELPCMD: execute command by list (all for all containers) exec) # HELPCMD: execute command by list (all for all virtual machines)
INCMD="$1" INCMD="$1"
shift shift
LIST="$(get_list "$@")" LIST="$(get_list "$@")"
...@@ -152,17 +152,17 @@ case $CMD in ...@@ -152,17 +152,17 @@ case $CMD in
todo a= docker exec -ti $SETLANG "$i" "$INCMD" todo a= docker exec -ti $SETLANG "$i" "$INCMD"
done done
;; ;;
enter) # HELPCMD: enter in a container with ID enter) # HELPCMD: enter in a virtual machine with ID
todo showcmd docker exec -ti $SETLANG "$1" bash todo showcmd docker exec -ti $SETLANG "$1" bash
todo a= docker exec -ti $SETLANG "$1" bash todo a= docker exec -ti $SETLANG "$1" bash
;; ;;
log|logs) # HELPCMD: print container log log|logs) # HELPCMD: print virtual machine log
todo docmd docker logs "$1" todo docmd docker logs "$1"
;; ;;
info) # HELPCMD: print containers(s) info (vzlist like) info) # HELPCMD: print virtual machines(s) info (vzlist like)
docmd vboxmanage list systemproperties docmd vboxmanage list systemproperties
;; ;;
load) # HELPCMD: print load average for container(s) by list load) # HELPCMD: print load average for virtual machine(s) by list
todo LOAD todo LOAD
#for id in $(get_list "$@") ; do #for id in $(get_list "$@") ; do
# HN=$(a= docker inspect --format '{{.Name}}' $id) # HN=$(a= docker inspect --format '{{.Name}}' $id)
...@@ -170,8 +170,8 @@ case $CMD in ...@@ -170,8 +170,8 @@ case $CMD in
# printf "%4s (%30s): %6s\n" $id $HN $CPU # printf "%4s (%30s): %6s\n" $id $HN $CPU
#done #done
;; ;;
destroy) # HELPCMD: destroy container(s) by list destroy) # HELPCMD: destroy virtual machine(s) by list
echo "You request to destroy follow containers:" echo "You request to destroy follow virtual machines:"
# don't support all/ALL # don't support all/ALL
#LIST="$(get_list "$@")" #LIST="$(get_list "$@")"
LIST="$@" LIST="$@"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment