Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
evz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Тимофей Смирнов
evz
Commits
c1108b9b
Commit
c1108b9b
authored
Feb 26, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LIST=$(get_list "$@") -> LIST="$(get_list "$@")"
parent
1aad89e2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
65 deletions
+63
-65
evz-docker
bin/evz-docker
+14
-14
evz-openvz
bin/evz-openvz
+12
-12
evz-pct
bin/evz-pct
+14
-14
evz-qm
bin/evz-qm
+12
-14
evz-vboxmanage
bin/evz-vboxmanage
+11
-11
No files found.
bin/evz-docker
View file @
c1108b9b
...
@@ -54,7 +54,7 @@ CMD=$1
...
@@ -54,7 +54,7 @@ CMD=$1
shift
shift
case
$CMD
in
case
$CMD
in
off
)
# HELPCMD: stop container(s) and disable start on boot
off
)
# HELPCMD: stop container(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 ..."
docmd docker stop
$i
docmd docker stop
$i
...
@@ -70,21 +70,21 @@ case $CMD in
...
@@ -70,21 +70,21 @@ case $CMD in
done
done
;;
;;
status
)
# HELPCMD: print container(s) status
status
)
# HELPCMD: print container(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
docmd docker stats
--no-stream
--no-trunc
$i
docmd docker stats
--no-stream
--no-trunc
$i
done
done
;;
;;
compact
)
# HELPCMD: do named operation on container(s)
compact
)
# HELPCMD: do named operation on container(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
..."
todo vzctl
$CMD
$i
todo vzctl
$CMD
$i
done
done
;;
;;
ports
)
# HELPCMD: show public ports
ports
)
# HELPCMD: show public ports
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 ..."
docmd docker port
$i
docmd docker port
$i
...
@@ -93,35 +93,35 @@ case $CMD in
...
@@ -93,35 +93,35 @@ case $CMD in
set
)
# HELPCMD: set param. Use with --option param
set
)
# HELPCMD: set param. Use with --option param
OPTIONS
=
"
$1
$2
"
OPTIONS
=
"
$1
$2
"
shift
2
shift
2
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
..."
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
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
showcmd docker stats
--no-stream
--no-trunc
showcmd docker stats
--no-stream
--no-trunc
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
a
=
docker stats
--no-stream
--no-trunc
$i
a
=
docker stats
--no-stream
--no-trunc
$i
done
done
;;
;;
stop
)
# HELPCMD: stop container(s)
stop
)
# HELPCMD: stop container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
"
$LIST
"
;
do
for
i
in
$LIST
;
do
info
"Stopping
$i
..."
info
"Stopping
$i
..."
docmd docker stop
$i
docmd docker stop
$i
done
done
;;
;;
start
)
# HELPCMD: start container(s)
start
)
# HELPCMD: start container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Starting
$i
..."
info
"Starting
$i
..."
docmd docker start
$i
docmd docker start
$i
done
done
;;
;;
restart
)
# HELPCMD: restart container(s)
restart
)
# HELPCMD: restart container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Restarting
$i
..."
info
"Restarting
$i
..."
docmd docker restart
$i
docmd docker restart
$i
...
@@ -142,7 +142,7 @@ case $CMD in
...
@@ -142,7 +142,7 @@ case $CMD in
exec
)
# HELPCMD: execute command by list (all for all containers)
exec
)
# HELPCMD: execute command by list (all for all containers)
INCMD
=
"
$1
"
INCMD
=
"
$1
"
shift
shift
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
showcmd docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
showcmd docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
a
=
docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
a
=
docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
...
@@ -156,8 +156,8 @@ case $CMD in
...
@@ -156,8 +156,8 @@ case $CMD in
docmd docker logs
"
$1
"
docmd docker logs
"
$1
"
;;
;;
info
)
# HELPCMD: print containers(s) info (vzlist like)
info
)
# HELPCMD: print containers(s) info (vzlist like)
#LIST=
$(get_list "$@")
#LIST=
"$(get_list "$@")"
showcmd docker ps
--format
'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}'
showcmd docker ps
--format
'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}'
"
$@
"
5
a
=
docker ps
--format
'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}'
"
$@
"
a
=
docker ps
--format
'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}'
"
$@
"
#for i in $LIST ; do
#for i in $LIST ; do
# a= docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}' "$@"
# a= docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}' "$@"
...
@@ -180,7 +180,7 @@ case $CMD in
...
@@ -180,7 +180,7 @@ case $CMD in
destroy
)
# HELPCMD: destroy container(s) by list
destroy
)
# HELPCMD: destroy container(s) by list
echo
"You request to destroy follow containers:"
echo
"You request to destroy follow containers:"
# don't support all/ALL
# don't support all/ALL
#LIST=
$(get_list "$@")
#LIST=
"$(get_list "$@")"
LIST
=
"
$@
"
LIST
=
"
$@
"
echo
"
$LIST
"
echo
"
$LIST
"
#local response
#local response
...
...
bin/evz-openvz
View file @
c1108b9b
...
@@ -39,7 +39,7 @@ CMD=$1
...
@@ -39,7 +39,7 @@ CMD=$1
shift
shift
case
$CMD
in
case
$CMD
in
off
)
# HELPCMD: stop container(s) and disable start on boot
off
)
# HELPCMD: stop container(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
..."
docmd vzctl stop
$i
docmd vzctl stop
$i
...
@@ -56,14 +56,14 @@ case $CMD in
...
@@ -56,14 +56,14 @@ case $CMD in
done
done
;;
;;
status
)
# HELPCMD: print container(s) status
status
)
# HELPCMD: print container(s) status
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
info
"Do vzctl
$CMD
for
$LIST
..."
info
"Do vzctl
$CMD
for
$LIST
..."
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
a
=
vzctl
$CMD
$i
a
=
vzctl
$CMD
$i
done
done
;;
;;
compact
)
# HELPCMD: do named operation on container(s)
compact
)
# HELPCMD: do named operation on container(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 ..."
docmd vzctl
$CMD
$i
docmd vzctl
$CMD
$i
...
@@ -72,35 +72,35 @@ case $CMD in
...
@@ -72,35 +72,35 @@ case $CMD in
set
)
# HELPCMD: set param. Use with --option param
set
)
# HELPCMD: set param. Use with --option param
OPTIONS
=
"
$1
$2
"
OPTIONS
=
"
$1
$2
"
shift
2
shift
2
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
..."
a
=
vzctl
$CMD
$i
$OPTIONS
--save
a
=
vzctl
$CMD
$i
$OPTIONS
--save
done
done
;;
;;
ubc|resources|show
)
# HELPCMD: print resource using via vzubc
ubc|resources|show
)
# HELPCMD: print resource using via vzubc
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 ..."
a
=
vzubc
$i
a
=
vzubc
$i
done
done
;;
;;
stop
)
# HELPCMD: stop container(s)
stop
)
# HELPCMD: stop container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
"
$LIST
"
;
do
for
i
in
$LIST
;
do
info
"Stopping
$i
..."
info
"Stopping
$i
..."
docmd vzctl stop
$i
docmd vzctl stop
$i
done
done
;;
;;
start
)
# HELPCMD: start container(s)
start
)
# HELPCMD: start container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Starting
$i
..."
info
"Starting
$i
..."
docmd vzctl start
$i
docmd vzctl start
$i
done
done
;;
;;
restart
)
# HELPCMD: restart container(s)
restart
)
# HELPCMD: restart container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Restarting
$i
..."
info
"Restarting
$i
..."
docmd vzctl restart
$i
docmd vzctl restart
$i
...
@@ -118,7 +118,7 @@ case $CMD in
...
@@ -118,7 +118,7 @@ case $CMD in
exec
)
# HELPCMD: execute command by list (all for all containers)
exec
)
# HELPCMD: execute command by list (all for all containers)
INCMD
=
"
$1
"
INCMD
=
"
$1
"
shift
shift
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
#info "Executing on $i ..."
#info "Executing on $i ..."
#printf "%3d: %s" $i "$(vzctl exec $i "$INCMD")"
#printf "%3d: %s" $i "$(vzctl exec $i "$INCMD")"
...
@@ -132,7 +132,7 @@ case $CMD in
...
@@ -132,7 +132,7 @@ case $CMD in
a
=
exec
vzctl enter
"
$1
"
a
=
exec
vzctl enter
"
$1
"
;;
;;
info
)
# HELPCMD: print containers(s) info (vzlist like)
info
)
# HELPCMD: print containers(s) info (vzlist like)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
#for i in $LIST ; do
#for i in $LIST ; do
#info "Executing on $i ..."
#info "Executing on $i ..."
#printf "%3d: %s" $i "$(vzctl exec $i "$INCMD")"
#printf "%3d: %s" $i "$(vzctl exec $i "$INCMD")"
...
@@ -157,7 +157,7 @@ case $CMD in
...
@@ -157,7 +157,7 @@ case $CMD in
destroy
)
# HELPCMD: destroy container(s) by list
destroy
)
# HELPCMD: destroy container(s) by list
echo
"You request to destroy follow containers:"
echo
"You request to destroy follow containers:"
#vzlist -a "$@"
#vzlist -a "$@"
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
echo
"
$LIST
"
echo
"
$LIST
"
#local response
#local response
read
-r
-p
"Are you sure? [Yes/No]"
response
read
-r
-p
"Are you sure? [Yes/No]"
response
...
...
bin/evz-pct
View file @
c1108b9b
...
@@ -52,7 +52,7 @@ CMD=$1
...
@@ -52,7 +52,7 @@ CMD=$1
shift
shift
case
$CMD
in
case
$CMD
in
off
)
# HELPCMD: stop container(s) and disable start on boot
off
)
# HELPCMD: stop container(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 ..."
docmd pct stop
$i
docmd pct stop
$i
...
@@ -68,21 +68,21 @@ case $CMD in
...
@@ -68,21 +68,21 @@ case $CMD in
done
done
;;
;;
status
)
# HELPCMD: print container(s) status
status
)
# HELPCMD: print container(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
docmd pct status
$i
docmd pct status
$i
done
done
;;
;;
compact
)
# HELPCMD: do named operation on container(s)
compact
)
# HELPCMD: do named operation on container(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
..."
todo vzctl
$CMD
$i
todo vzctl
$CMD
$i
done
done
;;
;;
ports
)
# HELPCMD: show public ports
ports
)
# HELPCMD: show public ports
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 ..."
todo docmd docker port
$i
todo docmd docker port
$i
...
@@ -91,21 +91,21 @@ case $CMD in
...
@@ -91,21 +91,21 @@ case $CMD in
set
)
# HELPCMD: set param. Use with --option param
set
)
# HELPCMD: set param. Use with --option param
OPTIONS
=
"
$1
$2
"
OPTIONS
=
"
$1
$2
"
shift
2
shift
2
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
..."
docmd pct
set
$i
$OPTIONS
docmd pct
set
$i
$OPTIONS
done
done
;;
;;
ubc|resources|show
)
# HELPCMD: print resource using
ubc|resources|show
)
# HELPCMD: print resource using
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
todo showcmd docker stats
--no-stream
--no-trunc
todo showcmd docker stats
--no-stream
--no-trunc
#for i in $LIST ; do
#for i in $LIST ; do
# a= docker stats --no-stream --no-trunc $i
# a= docker stats --no-stream --no-trunc $i
#done
#done
;;
;;
stop
)
# HELPCMD: stop container(s)
stop
)
# HELPCMD: stop container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Stopping
$i
..."
info
"Stopping
$i
..."
if
[
-n
"
$force
"
]
;
then
if
[
-n
"
$force
"
]
;
then
...
@@ -116,28 +116,28 @@ case $CMD in
...
@@ -116,28 +116,28 @@ case $CMD in
done
done
;;
;;
start
)
# HELPCMD: start container(s)
start
)
# HELPCMD: start container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Starting
$i
..."
info
"Starting
$i
..."
docmd pct start
$i
docmd pct start
$i
done
done
;;
;;
restart
)
# HELPCMD: restart container(s)
restart
)
# HELPCMD: restart container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Restarting
$i
..."
info
"Restarting
$i
..."
docmd pct reboot
$i
docmd pct reboot
$i
done
done
;;
;;
suspend
)
# HELPCMD: suspend container(s)
suspend
)
# HELPCMD: suspend container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Suspening
$i
..."
info
"Suspening
$i
..."
docmd pct
suspend
$i
docmd pct
suspend
$i
done
done
;;
;;
resume
)
# HELPCMD: resume container(s)
resume
)
# HELPCMD: resume container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Suspening
$i
..."
info
"Suspening
$i
..."
docmd pct resume
$i
docmd pct resume
$i
...
@@ -156,7 +156,7 @@ case $CMD in
...
@@ -156,7 +156,7 @@ case $CMD in
exec
)
# HELPCMD: execute command by list (all for all containers)
exec
)
# HELPCMD: execute command by list (all for all containers)
INCMD
=
"
$1
"
INCMD
=
"
$1
"
shift
shift
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
docmd pct
exec
"
$i
"
"
$INCMD
"
docmd pct
exec
"
$i
"
"
$INCMD
"
done
done
...
@@ -169,7 +169,7 @@ case $CMD in
...
@@ -169,7 +169,7 @@ case $CMD in
todo docmd docker logs
"
$1
"
todo docmd docker logs
"
$1
"
;;
;;
info
)
# HELPCMD: print containers(s) info (vzlist like)
info
)
# HELPCMD: print containers(s) info (vzlist like)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
#showcmd docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}'
#showcmd docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}'
#a= docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}' "$@"
#a= docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}' "$@"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
...
@@ -198,7 +198,7 @@ case $CMD in
...
@@ -198,7 +198,7 @@ case $CMD in
destroy
)
# HELPCMD: destroy container(s) by list
destroy
)
# HELPCMD: destroy container(s) by list
echo
"You request to destroy follow containers:"
echo
"You request to destroy follow containers:"
# don't support all/ALL
# don't support all/ALL
#LIST=
$(get_list "$@")
#LIST=
"$(get_list "$@")"
LIST
=
"
$@
"
LIST
=
"
$@
"
echo
"
$LIST
"
echo
"
$LIST
"
#local response
#local response
...
...
bin/evz-qm
View file @
c1108b9b
...
@@ -17,8 +17,6 @@
...
@@ -17,8 +17,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
SETLANG
=
"-e ru_RU.UTF8"
# list all running containers (or by arg list)
# list all running containers (or by arg list)
list_all
()
list_all
()
{
{
...
@@ -54,7 +52,7 @@ CMD=$1
...
@@ -54,7 +52,7 @@ CMD=$1
shift
shift
case
$CMD
in
case
$CMD
in
off
)
# HELPCMD: stop container(s) and disable start on boot
off
)
# HELPCMD: stop container(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 ..."
docmd qm stop
$i
docmd qm stop
$i
...
@@ -70,21 +68,21 @@ case $CMD in
...
@@ -70,21 +68,21 @@ case $CMD in
done
done
;;
;;
status
)
# HELPCMD: print container(s) status
status
)
# HELPCMD: print container(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
docmd qm status
$i
docmd qm status
$i
done
done
;;
;;
compact
)
# HELPCMD: do named operation on container(s)
compact
)
# HELPCMD: do named operation on container(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
..."
todo vzctl
$CMD
$i
todo vzctl
$CMD
$i
done
done
;;
;;
ports
)
# HELPCMD: show public ports
ports
)
# HELPCMD: show public ports
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 ..."
todo docmd docker port
$i
todo docmd docker port
$i
...
@@ -93,35 +91,35 @@ case $CMD in
...
@@ -93,35 +91,35 @@ case $CMD in
set
)
# HELPCMD: set param. Use with --option param
set
)
# HELPCMD: set param. Use with --option param
OPTIONS
=
"
$1
$2
"
OPTIONS
=
"
$1
$2
"
shift
2
shift
2
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
..."
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
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
todo showcmd docker stats
--no-stream
--no-trunc
todo showcmd docker stats
--no-stream
--no-trunc
#for i in $LIST ; do
#for i in $LIST ; do
# a= docker stats --no-stream --no-trunc $i
# a= docker stats --no-stream --no-trunc $i
#done
#done
;;
;;
stop
)
# HELPCMD: stop container(s)
stop
)
# HELPCMD: stop container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Stopping
$i
..."
info
"Stopping
$i
..."
docmd qm stop
$i
docmd qm stop
$i
done
done
;;
;;
start
)
# HELPCMD: start container(s)
start
)
# HELPCMD: start container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Starting
$i
..."
info
"Starting
$i
..."
docmd qm start
$i
docmd qm start
$i
done
done
;;
;;
restart
)
# HELPCMD: restart container(s)
restart
)
# HELPCMD: restart container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Restarting
$i
..."
info
"Restarting
$i
..."
docmd qm reboot
$i
docmd qm reboot
$i
...
@@ -140,7 +138,7 @@ case $CMD in
...
@@ -140,7 +138,7 @@ case $CMD in
exec
)
# HELPCMD: execute command by list (all for all containers)
exec
)
# HELPCMD: execute command by list (all for all containers)
INCMD
=
"
$1
"
INCMD
=
"
$1
"
shift
shift
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
todo showcmd docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
todo showcmd docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
#a= docker exec -ti $SETLANG "$i" "$INCMD"
#a= docker exec -ti $SETLANG "$i" "$INCMD"
...
@@ -154,7 +152,7 @@ case $CMD in
...
@@ -154,7 +152,7 @@ case $CMD in
todo docmd docker logs
"
$1
"
todo docmd docker logs
"
$1
"
;;
;;
info
)
# HELPCMD: print containers(s) info (vzlist like)
info
)
# HELPCMD: print containers(s) info (vzlist like)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
#showcmd docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}'
#showcmd docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}'
#a= docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}' "$@"
#a= docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}' "$@"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
...
@@ -183,7 +181,7 @@ case $CMD in
...
@@ -183,7 +181,7 @@ case $CMD in
destroy
)
# HELPCMD: destroy container(s) by list
destroy
)
# HELPCMD: destroy container(s) by list
echo
"You request to destroy follow containers:"
echo
"You request to destroy follow containers:"
# don't support all/ALL
# don't support all/ALL
#LIST=
$(get_list "$@")
#LIST=
"$(get_list "$@")"
LIST
=
"
$@
"
LIST
=
"
$@
"
echo
"
$LIST
"
echo
"
$LIST
"
#local response
#local response
...
...
bin/evz-vboxmanage
View file @
c1108b9b
...
@@ -54,7 +54,7 @@ CMD=$1
...
@@ -54,7 +54,7 @@ CMD=$1
shift
shift
case
$CMD
in
case
$CMD
in
off
)
# HELPCMD: stop container(s) and disable start on boot
off
)
# HELPCMD: stop container(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 ..."
todo docmd docker stop
$i
todo docmd docker stop
$i
...
@@ -70,21 +70,21 @@ case $CMD in
...
@@ -70,21 +70,21 @@ case $CMD in
done
done
;;
;;
status
)
# HELPCMD: print container(s) status
status
)
# HELPCMD: print container(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 container(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
..."
todo vzctl
$CMD
$i
todo vzctl
$CMD
$i
done
done
;;
;;
ports
)
# HELPCMD: show public ports
ports
)
# HELPCMD: show public ports
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 ..."
todo docmd docker port
$i
todo docmd docker port
$i
...
@@ -93,20 +93,20 @@ case $CMD in
...
@@ -93,20 +93,20 @@ case $CMD in
set
)
# HELPCMD: set param. Use with --option param
set
)
# HELPCMD: set param. Use with --option param
OPTIONS
=
"
$1
$2
"
OPTIONS
=
"
$1
$2
"
shift
2
shift
2
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
..."
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
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 container(s)
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Stopping
$i
..."
info
"Stopping
$i
..."
if
[
-n
"
$force
"
]
;
then
if
[
-n
"
$force
"
]
;
then
...
@@ -117,14 +117,14 @@ case $CMD in
...
@@ -117,14 +117,14 @@ case $CMD in
done
done
;;
;;
start
)
# HELPCMD: start container(s)
start
)
# HELPCMD: start container(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 container(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
...
@@ -146,7 +146,7 @@ case $CMD in
...
@@ -146,7 +146,7 @@ case $CMD in
exec
)
# HELPCMD: execute command by list (all for all containers)
exec
)
# HELPCMD: execute command by list (all for all containers)
INCMD
=
"
$1
"
INCMD
=
"
$1
"
shift
shift
LIST
=
$(
get_list
"
$@
"
)
LIST
=
"
$(
get_list
"
$@
"
)
"
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
todo showcmd docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
todo showcmd docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
todo
a
=
docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
todo
a
=
docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
...
@@ -173,7 +173,7 @@ case $CMD in
...
@@ -173,7 +173,7 @@ case $CMD in
destroy
)
# HELPCMD: destroy container(s) by list
destroy
)
# HELPCMD: destroy container(s) by list
echo
"You request to destroy follow containers:"
echo
"You request to destroy follow containers:"
# don't support all/ALL
# don't support all/ALL
#LIST=
$(get_list "$@")
#LIST=
"$(get_list "$@")"
LIST
=
"
$@
"
LIST
=
"
$@
"
echo
"
$LIST
"
echo
"
$LIST
"
#local response
#local response
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment