if only one container, auto select it

This commit is contained in:
Heavybullets8 2022-08-10 16:30:07 -06:00
parent 074b3d09cf
commit 6f7f18d6a4

View File

@ -31,8 +31,11 @@ for pod in "${pod_id[@]}"
do do
echo "$search" | grep "$pod" | awk '{print $4}' echo "$search" | grep "$pod" | awk '{print $4}'
done | nl -s ") " | column -t) done | nl -s ") " | column -t)
while true if [[ "${#pod_id[@]}" == 1 ]]; then
do container_id=$(echo "$search" | grep -E "[[:space:]]${container}[[:space:]]" | awk '{print $1}')
else
while true
do
clear -x clear -x
title title
echo "$containers" echo "$containers"
@ -49,9 +52,10 @@ do
else else
break break
fi fi
done done
container=$(echo "$containers" | grep ^"$selection)" | awk '{print $2}') container=$(echo "$containers" | grep ^"$selection)" | awk '{print $2}')
container_id=$(echo "$search" | grep -E "[[:space:]]${container}[[:space:]]" | awk '{print $1}') container_id=$(echo "$search" | grep -E "[[:space:]]${container}[[:space:]]" | awk '{print $1}')
fi
while true while true
do do
clear -x clear -x