Commit c1108b9b authored by Vitaly Lipatov's avatar Vitaly Lipatov

LIST=$(get_list "$@") -> LIST="$(get_list "$@")"

parent 1aad89e2
......@@ -54,7 +54,7 @@ CMD=$1
shift
case $CMD in
off) # HELPCMD: stop container(s) and disable start on boot
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
#info "Stopping $i ..."
docmd docker stop $i
......@@ -70,21 +70,21 @@ case $CMD in
done
;;
status) # HELPCMD: print container(s) status
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
#info "Do $CMD for $LIST ..."
for i in $LIST ; do
docmd docker stats --no-stream --no-trunc $i
done
;;
compact) # HELPCMD: do named operation on container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Do $CMD on $i ..."
todo vzctl $CMD $i
done
;;
ports) # HELPCMD: show public ports
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
#info "Do $CMD on $i ..."
docmd docker port $i
......@@ -93,35 +93,35 @@ case $CMD in
set) # HELPCMD: set param. Use with --option param
OPTIONS="$1 $2"
shift 2
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Do $CMD on $i ..."
todo vzctl $CMD $i $OPTIONS --save
done
;;
ubc|resources|show) # HELPCMD: print resource using
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
showcmd docker stats --no-stream --no-trunc
for i in $LIST ; do
a= docker stats --no-stream --no-trunc $i
done
;;
stop) # HELPCMD: stop container(s)
LIST=$(get_list "$@")
for i in "$LIST" ; do
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Stopping $i ..."
docmd docker stop $i
done
;;
start) # HELPCMD: start container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Starting $i ..."
docmd docker start $i
done
;;
restart) # HELPCMD: restart container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Restarting $i ..."
docmd docker restart $i
......@@ -142,7 +142,7 @@ case $CMD in
exec) # HELPCMD: execute command by list (all for all containers)
INCMD="$1"
shift
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
showcmd docker exec -ti $SETLANG "$i" "$INCMD"
a= docker exec -ti $SETLANG "$i" "$INCMD"
......@@ -156,8 +156,8 @@ case $CMD in
docmd docker logs "$1"
;;
info) # HELPCMD: print containers(s) info (vzlist like)
#LIST=$(get_list "$@")
showcmd docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}'
#LIST="$(get_list "$@")"
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}}' "$@"
#for i in $LIST ; do
# a= docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}' "$@"
......@@ -180,7 +180,7 @@ case $CMD in
destroy) # HELPCMD: destroy container(s) by list
echo "You request to destroy follow containers:"
# don't support all/ALL
#LIST=$(get_list "$@")
#LIST="$(get_list "$@")"
LIST="$@"
echo "$LIST"
#local response
......
......@@ -39,7 +39,7 @@ CMD=$1
shift
case $CMD in
off) # HELPCMD: stop container(s) and disable start on boot
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Stopping $i ..."
docmd vzctl stop $i
......@@ -56,14 +56,14 @@ case $CMD in
done
;;
status) # HELPCMD: print container(s) status
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
info "Do vzctl $CMD for $LIST ..."
for i in $LIST ; do
a= vzctl $CMD $i
done
;;
compact) # HELPCMD: do named operation on container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
#info "Do $CMD on $i ..."
docmd vzctl $CMD $i
......@@ -72,35 +72,35 @@ case $CMD in
set) # HELPCMD: set param. Use with --option param
OPTIONS="$1 $2"
shift 2
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Do $CMD on $i ..."
a= vzctl $CMD $i $OPTIONS --save
done
;;
ubc|resources|show) # HELPCMD: print resource using via vzubc
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
#info "Do $CMD on $i ..."
a= vzubc $i
done
;;
stop) # HELPCMD: stop container(s)
LIST=$(get_list "$@")
for i in "$LIST" ; do
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Stopping $i ..."
docmd vzctl stop $i
done
;;
start) # HELPCMD: start container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Starting $i ..."
docmd vzctl start $i
done
;;
restart) # HELPCMD: restart container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Restarting $i ..."
docmd vzctl restart $i
......@@ -118,7 +118,7 @@ case $CMD in
exec) # HELPCMD: execute command by list (all for all containers)
INCMD="$1"
shift
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
#info "Executing on $i ..."
#printf "%3d: %s" $i "$(vzctl exec $i "$INCMD")"
......@@ -132,7 +132,7 @@ case $CMD in
a= exec vzctl enter "$1"
;;
info) # HELPCMD: print containers(s) info (vzlist like)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
#for i in $LIST ; do
#info "Executing on $i ..."
#printf "%3d: %s" $i "$(vzctl exec $i "$INCMD")"
......@@ -157,7 +157,7 @@ case $CMD in
destroy) # HELPCMD: destroy container(s) by list
echo "You request to destroy follow containers:"
#vzlist -a "$@"
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
echo "$LIST"
#local response
read -r -p "Are you sure? [Yes/No]" response
......
......@@ -52,7 +52,7 @@ CMD=$1
shift
case $CMD in
off) # HELPCMD: stop container(s) and disable start on boot
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
#info "Stopping $i ..."
docmd pct stop $i
......@@ -68,21 +68,21 @@ case $CMD in
done
;;
status) # HELPCMD: print container(s) status
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
#info "Do $CMD for $LIST ..."
for i in $LIST ; do
docmd pct status $i
done
;;
compact) # HELPCMD: do named operation on container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Do $CMD on $i ..."
todo vzctl $CMD $i
done
;;
ports) # HELPCMD: show public ports
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
#info "Do $CMD on $i ..."
todo docmd docker port $i
......@@ -91,21 +91,21 @@ case $CMD in
set) # HELPCMD: set param. Use with --option param
OPTIONS="$1 $2"
shift 2
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Do $CMD on $i ..."
docmd pct set $i $OPTIONS
done
;;
ubc|resources|show) # HELPCMD: print resource using
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
todo showcmd docker stats --no-stream --no-trunc
#for i in $LIST ; do
# a= docker stats --no-stream --no-trunc $i
#done
;;
stop) # HELPCMD: stop container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Stopping $i ..."
if [ -n "$force" ] ; then
......@@ -116,28 +116,28 @@ case $CMD in
done
;;
start) # HELPCMD: start container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Starting $i ..."
docmd pct start $i
done
;;
restart) # HELPCMD: restart container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Restarting $i ..."
docmd pct reboot $i
done
;;
suspend) # HELPCMD: suspend container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Suspening $i ..."
docmd pct suspend $i
done
;;
resume) # HELPCMD: resume container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Suspening $i ..."
docmd pct resume $i
......@@ -156,7 +156,7 @@ case $CMD in
exec) # HELPCMD: execute command by list (all for all containers)
INCMD="$1"
shift
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
docmd pct exec "$i" "$INCMD"
done
......@@ -169,7 +169,7 @@ case $CMD in
todo docmd docker logs "$1"
;;
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}}'
#a= docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}' "$@"
for i in $LIST ; do
......@@ -198,7 +198,7 @@ case $CMD in
destroy) # HELPCMD: destroy container(s) by list
echo "You request to destroy follow containers:"
# don't support all/ALL
#LIST=$(get_list "$@")
#LIST="$(get_list "$@")"
LIST="$@"
echo "$LIST"
#local response
......
......@@ -17,8 +17,6 @@
# 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()
{
......@@ -54,7 +52,7 @@ CMD=$1
shift
case $CMD in
off) # HELPCMD: stop container(s) and disable start on boot
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
#info "Stopping $i ..."
docmd qm stop $i
......@@ -70,21 +68,21 @@ case $CMD in
done
;;
status) # HELPCMD: print container(s) status
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
#info "Do $CMD for $LIST ..."
for i in $LIST ; do
docmd qm status $i
done
;;
compact) # HELPCMD: do named operation on container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Do $CMD on $i ..."
todo vzctl $CMD $i
done
;;
ports) # HELPCMD: show public ports
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
#info "Do $CMD on $i ..."
todo docmd docker port $i
......@@ -93,35 +91,35 @@ case $CMD in
set) # HELPCMD: set param. Use with --option param
OPTIONS="$1 $2"
shift 2
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Do $CMD on $i ..."
todo vzctl $CMD $i $OPTIONS --save
done
;;
ubc|resources|show) # HELPCMD: print resource using
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
todo showcmd docker stats --no-stream --no-trunc
#for i in $LIST ; do
# a= docker stats --no-stream --no-trunc $i
#done
;;
stop) # HELPCMD: stop container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Stopping $i ..."
docmd qm stop $i
done
;;
start) # HELPCMD: start container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Starting $i ..."
docmd qm start $i
done
;;
restart) # HELPCMD: restart container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Restarting $i ..."
docmd qm reboot $i
......@@ -140,7 +138,7 @@ case $CMD in
exec) # HELPCMD: execute command by list (all for all containers)
INCMD="$1"
shift
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
todo showcmd docker exec -ti $SETLANG "$i" "$INCMD"
#a= docker exec -ti $SETLANG "$i" "$INCMD"
......@@ -154,7 +152,7 @@ case $CMD in
todo docmd docker logs "$1"
;;
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}}'
#a= docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Status}}\t{{.Names}}\t{{.Size}}' "$@"
for i in $LIST ; do
......@@ -183,7 +181,7 @@ case $CMD in
destroy) # HELPCMD: destroy container(s) by list
echo "You request to destroy follow containers:"
# don't support all/ALL
#LIST=$(get_list "$@")
#LIST="$(get_list "$@")"
LIST="$@"
echo "$LIST"
#local response
......
......@@ -54,7 +54,7 @@ CMD=$1
shift
case $CMD in
off) # HELPCMD: stop container(s) and disable start on boot
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
#info "Stopping $i ..."
todo docmd docker stop $i
......@@ -70,21 +70,21 @@ case $CMD in
done
;;
status) # HELPCMD: print container(s) status
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
#info "Do $CMD for $LIST ..."
for i in $LIST ; do
todo docmd docker stats --no-stream --no-trunc $i
done
;;
compact) # HELPCMD: do named operation on container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Do $CMD on $i ..."
todo vzctl $CMD $i
done
;;
ports) # HELPCMD: show public ports
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
#info "Do $CMD on $i ..."
todo docmd docker port $i
......@@ -93,20 +93,20 @@ case $CMD in
set) # HELPCMD: set param. Use with --option param
OPTIONS="$1 $2"
shift 2
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Do $CMD on $i ..."
todo vzctl $CMD $i $OPTIONS --save
done
;;
ubc|resources|show) # HELPCMD: print resource using
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
docmd vboxmanage showvminfo $i
done
;;
stop) # HELPCMD: stop container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Stopping $i ..."
if [ -n "$force" ] ; then
......@@ -117,14 +117,14 @@ case $CMD in
done
;;
start) # HELPCMD: start container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Starting $i ..."
docmd vboxmanage startvm --type headless $i
done
;;
restart) # HELPCMD: restart container(s)
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
info "Restarting $i ..."
todo docmd ker restart $i
......@@ -146,7 +146,7 @@ case $CMD in
exec) # HELPCMD: execute command by list (all for all containers)
INCMD="$1"
shift
LIST=$(get_list "$@")
LIST="$(get_list "$@")"
for i in $LIST ; do
todo showcmd docker exec -ti $SETLANG "$i" "$INCMD"
todo a= docker exec -ti $SETLANG "$i" "$INCMD"
......@@ -173,7 +173,7 @@ case $CMD in
destroy) # HELPCMD: destroy container(s) by list
echo "You request to destroy follow containers:"
# don't support all/ALL
#LIST=$(get_list "$@")
#LIST="$(get_list "$@")"
LIST="$@"
echo "$LIST"
#local response
......
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