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,6 +31,9 @@ for pod in "${pod_id[@]}"
do
echo "$search" | grep "$pod" | awk '{print $4}'
done | nl -s ") " | column -t)
if [[ "${#pod_id[@]}" == 1 ]]; then
container_id=$(echo "$search" | grep -E "[[:space:]]${container}[[:space:]]" | awk '{print $1}')
else
while true
do
clear -x
@ -52,6 +55,7 @@ do
done
container=$(echo "$containers" | grep ^"$selection)" | awk '{print $2}')
container_id=$(echo "$search" | grep -E "[[:space:]]${container}[[:space:]]" | awk '{print $1}')
fi
while true
do
clear -x