Skip to content

Commit

Permalink
Switch to double ==
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaSBrown committed Feb 19, 2024
1 parent 57d490f commit 25c8236
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions scripts/container_stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ then
fi
done

elif [ "$local_NAME_FLAG_DETECTED" = "1" ]
elif [ "$local_NAME_FLAG_DETECTED" == "1" ]
then

for (( i=0; i<${#CONTAINER_IDS[@]}; i++)); do
NAME="${CONTAINER_NAMES[$i]}"
if [ "$NAME" = "$local_CONTAINER_NAME" ]
if [ "$NAME" == "$local_CONTAINER_NAME" ]
then
echo "Stopping ${CONTAINER_IDS[$i]} ${CONTAINER_NAMES[$i]} ${CONTAINER_IMAGES[$i]}"
docker container stop --time "$SLEEP_TIME" "${CONTAINER_IDS[$i]}"
Expand All @@ -102,7 +102,7 @@ else

fi

if [ ! "${#CONTAINER_IDS[@]}" = "0" ]
if [ ! "${#CONTAINER_IDS[@]}" == "0" ]
then
sleep "$SLEEP_TIME"
fi
Expand All @@ -112,24 +112,24 @@ CONTAINER_IDS=($(docker container ls --format "{{.ID}}"))
CONTAINER_IMAGES=($(docker container ls --format "{{.Image}}"))
CONTAINER_NAMES=($(docker container ls --format "{{.Names}}"))

if [ "$local_TAG_FLAG_DETECTED" = "1" ]
if [ "$local_TAG_FLAG_DETECTED" == "1" ]
then

for (( i=0; i<${#CONTAINER_IDS[@]}; i++)); do
IMAGE="${CONTAINER_IMAGES[$i]}"
if [ "$IMAGE" = "local_CONTAINER_TAG" ]
if [ "$IMAGE" == "local_CONTAINER_TAG" ]
then
echo "ERROR still running ${CONTAINER_IDS[$i]} ${CONTAINER_NAMES[$i]} $IMAGE"
exit 1
fi
done

elif [ "$local_NAME_FLAG_DETECTED" = "1" ]
elif [ "$local_NAME_FLAG_DETECTED" == "1" ]
then

for (( i=0; i<${#CONTAINER_IDS[@]}; i++)); do
NAME="${CONTAINER_NAMES[$i]}"
if [ "$NAME" = "local_CONTAINER_NAME" ]
if [ "$NAME" == "local_CONTAINER_NAME" ]
then
echo "ERROR still running ${CONTAINER_IDS[$i]} ${CONTAINER_NAMES[$i]} ${CONTAINER_IMAGES[$i]}"
exit 1
Expand All @@ -138,7 +138,7 @@ then

else

if [ ! "${#CONTAINER_IDS[@]}" = "0" ]
if [ ! "${#CONTAINER_IDS[@]}" == "0" ]
then
docker container ls
exit 1
Expand Down

0 comments on commit 25c8236

Please sign in to comment.