test
This commit is contained in:
parent
cc8a0d3708
commit
60418e846b
@ -27,9 +27,9 @@ search=$(k3s crictl ps -a -s running | sed -E 's/[[:space:]]([0-9]*|About)[a-z0-
|
|||||||
mapfile -t pod_id < <(echo "$search" | grep -E "[[:space:]]$app_name([[:space:]]|-([-[:alnum:]])*[[:space:]])" | awk '{print $(NF)}')
|
mapfile -t pod_id < <(echo "$search" | grep -E "[[:space:]]$app_name([[:space:]]|-([-[:alnum:]])*[[:space:]])" | awk '{print $(NF)}')
|
||||||
for pod in "${pod_id[@]}"
|
for pod in "${pod_id[@]}"
|
||||||
do
|
do
|
||||||
containers+=("$(echo "$search" | grep "$pod" | awk '{print $4}')")
|
printf '%s\0' "${containers[@]}" | grep -Fxqz -- "$(echo "$search" | grep "$pod" | awk '{print $4}' | tr -d " \t\r ")" && continue
|
||||||
|
containers+=("$(echo "$search" | grep "$pod" | awk '{print $4}' | tr -d " \t\r ")")
|
||||||
done
|
done
|
||||||
# containers=(); while IFS= read -r -d '' x; do containers+=("$x"); done < <(printf "%s\0" "${containers_temp[@]}" | sort -uz)
|
|
||||||
case "${#containers[@]}" in
|
case "${#containers[@]}" in
|
||||||
0)
|
0)
|
||||||
echo -e "No containers available\nAre you sure the application in running?"
|
echo -e "No containers available\nAre you sure the application in running?"
|
||||||
@ -49,7 +49,7 @@ case "${#containers[@]}" in
|
|||||||
for i in "${containers[@]}"
|
for i in "${containers[@]}"
|
||||||
do
|
do
|
||||||
echo "$i"
|
echo "$i"
|
||||||
done | uniq | nl -s ") " | column -t
|
done | nl -s ") " | column -t
|
||||||
)
|
)
|
||||||
echo "$cont_search"
|
echo "$cont_search"
|
||||||
echo
|
echo
|
||||||
|
Loading…
Reference in New Issue
Block a user