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
a03c8a09
Commit
a03c8a09
authored
Mar 07, 2020
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
detect containters id in set / exec group operations
parent
5d96d662
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
33 deletions
+117
-33
evz-docker
bin/evz-docker
+22
-10
evz-functions
bin/evz-functions
+11
-0
evz-pct
bin/evz-pct
+34
-8
evz-vboxmanage
bin/evz-vboxmanage
+17
-5
evz-vzctl
bin/evz-vzctl
+33
-10
No files found.
bin/evz-docker
View file @
a03c8a09
...
@@ -91,9 +91,6 @@ case $CMD in
...
@@ -91,9 +91,6 @@ case $CMD in
done
done
;;
;;
set
)
# HELPCMD: set param. Use with --option param
set
)
# HELPCMD: set param. Use with --option param
OPTIONS
=
"
$1
$2
"
shift
2
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
...
@@ -140,17 +137,32 @@ case $CMD in
...
@@ -140,17 +137,32 @@ case $CMD in
info
"See evz ports ID for print ports"
info
"See evz ports ID for print ports"
;;
;;
exec
)
# HELPCMD: execute command by list (all for all containers)
exec
)
# HELPCMD: execute command by list (all for all containers)
INCMD
=
"
$1
"
###################################
shift
# the same code like in set)
LIST
=
"
$(
get_list
"
$@
"
)
"
# get all args until ids or all/ALL
LIST
=
""
if
arg_is_all
"
$1
"
;
then
LIST
=
"
$(
get_list
"
$1
"
)
"
shift
else
while
[
-n
"
$1
"
]
;
do
arg_is_id
"
$1
"
||
break
LIST
=
"
$LIST
$1
"
shift
done
fi
###################################
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
showcmd docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
showcmd docker
exec
-ti
$SETLANG
"
$i
"
"
$@
"
a
=
docker
exec
-ti
$SETLANG
"
$i
"
"
$INCMD
"
a
=
docker
exec
-ti
$SETLANG
"
$i
"
"
$@
"
done
done
;;
;;
enter
)
# HELPCMD: enter in a container with ID
enter
)
# HELPCMD: enter in a container with ID
showcmd docker
exec
-ti
$SETLANG
"
$1
"
bash
ID
=
"
$1
"
a
=
docker
exec
-ti
$SETLANG
"
$1
"
bash
shift
showcmd docker
exec
-ti
$SETLANG
"
$ID
"
bash
a
=
docker
exec
-ti
$SETLANG
"
$ID
"
bash
;;
;;
log|logs
)
# HELPCMD: print container log
log|logs
)
# HELPCMD: print container log
docmd docker logs
"
$1
"
docmd docker logs
"
$1
"
...
...
bin/evz-functions
View file @
a03c8a09
...
@@ -41,3 +41,14 @@ get_list()
...
@@ -41,3 +41,14 @@ get_list()
list_all
list_all
}
}
arg_is_id
()
{
echo
"
$(
list_ALL
)
"
|
grep
-q
"
$1
"
}
arg_is_all
()
{
[
"
$1
"
=
"ALL"
]
&&
return
[
"
$1
"
=
"all"
]
&&
return
return
1
}
bin/evz-pct
View file @
a03c8a09
...
@@ -89,12 +89,25 @@ case $CMD in
...
@@ -89,12 +89,25 @@ case $CMD in
done
done
;;
;;
set
)
# HELPCMD: set param. Use with --option param
set
)
# HELPCMD: set param. Use with --option param
OPTIONS
=
"
$1
$2
"
###################################
shift
2
# the same code like in set)
LIST
=
"
$(
get_list
"
$@
"
)
"
# get all args until ids or all/ALL
LIST
=
""
if
arg_is_all
"
$1
"
;
then
LIST
=
"
$(
get_list
"
$1
"
)
"
shift
else
while
[
-n
"
$1
"
]
;
do
arg_is_id
"
$1
"
||
break
LIST
=
"
$LIST
$1
"
shift
done
fi
###################################
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
"
$@
"
done
done
;;
;;
ubc|resources|show
)
# HELPCMD: print resource using
ubc|resources|show
)
# HELPCMD: print resource using
...
@@ -154,11 +167,24 @@ case $CMD in
...
@@ -154,11 +167,24 @@ case $CMD in
#info "See evz ports ID for print ports"
#info "See evz ports ID for print ports"
;;
;;
exec
)
# HELPCMD: execute command by list (all for all containers)
exec
)
# HELPCMD: execute command by list (all for all containers)
INCMD
=
"
$1
"
###################################
shift
# the same code like in set)
LIST
=
"
$(
get_list
"
$@
"
)
"
# get all args until ids or all/ALL
LIST
=
""
if
arg_is_all
"
$1
"
;
then
LIST
=
"
$(
get_list
"
$1
"
)
"
shift
else
while
[
-n
"
$1
"
]
;
do
arg_is_id
"
$1
"
||
break
LIST
=
"
$LIST
$1
"
shift
done
fi
###################################
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
docmd pct
exec
"
$i
"
"
$
INCMD
"
docmd pct
exec
"
$i
"
"
$
@
"
done
done
;;
;;
enter
)
# HELPCMD: enter in a container with ID
enter
)
# HELPCMD: enter in a container with ID
...
...
bin/evz-vboxmanage
View file @
a03c8a09
...
@@ -90,14 +90,26 @@ case $CMD in
...
@@ -90,14 +90,26 @@ case $CMD in
done
done
;;
;;
set
)
# HELPCMD: set param. Use with --option param
set
)
# HELPCMD: set param. Use with --option param
OPTIONS
=
"
$1
$2
"
###################################
shift
2
# the same code like in set)
LIST
=
"
$(
get_list
"
$@
"
)
"
# get all args until ids or all/ALL
LIST
=
""
if
arg_is_all
"
$1
"
;
then
LIST
=
"
$(
get_list
"
$1
"
)
"
shift
else
while
[
-n
"
$1
"
]
;
do
arg_is_id
"
$1
"
||
break
LIST
=
"
$LIST
$1
"
shift
done
fi
###################################
# show help if empty
# show help if empty
[
-n
"
$LIST
"
]
||
docmd vboxmanage modifyvm
[
-n
"
$LIST
"
]
||
docmd vboxmanage modifyvm
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Do
$CMD
on
$i
..."
docmd vboxmanage modifyvm
$i
"
$@
"
docmd vboxmanage modifyvm
$i
$OPTIONS
done
done
;;
;;
ubc|resources|show
)
# HELPCMD: print resource using by virtual machine(s)
ubc|resources|show
)
# HELPCMD: print resource using by virtual machine(s)
...
...
bin/evz-vzctl
View file @
a03c8a09
...
@@ -70,12 +70,23 @@ case $CMD in
...
@@ -70,12 +70,23 @@ case $CMD in
done
done
;;
;;
set
)
# HELPCMD: set param. Use with --option param
set
)
# HELPCMD: set param. Use with --option param
OPTIONS
=
"
$1
$2
"
###################################
shift
2
# get all args until ids or all/ALL
LIST
=
"
$(
get_list
"
$@
"
)
"
LIST
=
""
if
arg_is_all
"
$1
"
;
then
LIST
=
"
$(
get_list
"
$1
"
)
"
shift
else
while
[
-n
"
$1
"
]
;
do
arg_is_id
"
$1
"
||
break
LIST
=
"
$LIST
$1
"
shift
done
fi
###################################
for
i
in
$LIST
;
do
for
i
in
$LIST
;
do
info
"Do
$CMD
on
$i
..."
docmd vzctl
$CMD
$i
"
$@
"
--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
...
@@ -116,15 +127,27 @@ case $CMD in
...
@@ -116,15 +127,27 @@ case $CMD in
a
=
vzlist
"
$@
"
a
=
vzlist
"
$@
"
;;
;;
exec
)
# HELPCMD: execute command by list (all for all containers)
exec
)
# HELPCMD: execute command by list (all for all containers)
INCMD
=
"
$1
"
###################################
shift
# the same code like in set)
LIST
=
"
$(
get_list
"
$@
"
)
"
# get all args until ids or all/ALL
LIST
=
""
if
arg_is_all
"
$1
"
;
then
LIST
=
"
$(
get_list
"
$1
"
)
"
shift
else
while
[
-n
"
$1
"
]
;
do
arg_is_id
"
$1
"
||
break
LIST
=
"
$LIST
$1
"
shift
done
fi
###################################
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")"
#vzctl exec $i "$INCMD" | sed -e "s|^|$(printf "%3d: " $i)|g"
#vzctl exec $i "$INCMD" | sed -e "s|^|$(printf "%3d: " $i)|g"
showcmd vzctl
exec
$i
"
$INCMD
"
docmd vzctl
exec
$i
"
$@
"
a
=
vzctl
exec
$i
"
$INCMD
"
done
done
;;
;;
enter
)
# HELPCMD: enter in a container with ID
enter
)
# HELPCMD: enter in a container with ID
...
...
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