works
This commit is contained in:
parent
ba58fecf89
commit
c6d0926fc2
@ -28,15 +28,14 @@ mapfile -t pod_id < <(echo "$search" | grep -E "[[:space:]]$app_name([[:space:]]
|
|||||||
for pod in "${pod_id[@]}"
|
for pod in "${pod_id[@]}"
|
||||||
do
|
do
|
||||||
containers+=("$(echo "$search" | grep "$pod" | awk '{print $4}')")
|
containers+=("$(echo "$search" | grep "$pod" | awk '{print $4}')")
|
||||||
echo "${#containers[@]}"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ "${#containers[@]}" == 1 ]]; then
|
if [[ "${#containers[@]}" == 0 ]]; then
|
||||||
container=$(echo "$search" | grep "${pod_id[*]}" | awk '{print $4}')
|
|
||||||
container_id=$(echo "$search" | grep -E "[[:space:]]${container}[[:space:]]" | awk '{print $1}')
|
|
||||||
elif [[ "${#containers[@]}" == 0 ]]; then
|
|
||||||
echo -e "No containers available\nAre you sure the application in running?"
|
echo -e "No containers available\nAre you sure the application in running?"
|
||||||
exit
|
exit
|
||||||
|
elif [[ "${#containers[@]}" == 1 ]]; then
|
||||||
|
container=$(echo "$search" | grep "${pod_id[*]}" | awk '{print $4}')
|
||||||
|
container_id=$(echo "$search" | grep -E "[[:space:]]${container}[[:space:]]" | awk '{print $1}')
|
||||||
else
|
else
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
|
Loading…
Reference in New Issue
Block a user