Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions heartbeat/docker-compose
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh
# Version: 1.1.2
# Date: 2020-06-24

# Version: 1.1.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should increase the version nr, not decrease it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

# Date: 2020-12-11
#
# Resource script for running docker-compose
#
Expand Down Expand Up @@ -140,7 +141,8 @@ docker_compose_status()
if [ -r "$DIR/$YML" ]; then

DKPS=$(cd $DIR; $COMMAND ps -q)
STAT_MSG=$(docker ps --no-trunc | grep -E $(echo "$DKPS" | tr '\n' '|') | expand)
STAT_MSG=$(docker ps --no-trunc | expand)
PSTAT_MSG=$(docker ps --no-trunc | grep -E $(echo "$DKPS" | tr '\n' '|' | sed 's/|$//') | expand)
LNWTH=$(echo "$STAT_MSG" | head -n1 | wc -c)
STATEPOS=$(echo "$STAT_MSG" | head -n1 | egrep -o 'STATUS.*$' | wc -c)
OFFSET=$(($LNWTH-$STATEPOS+1))
Expand All @@ -150,7 +152,7 @@ docker_compose_status()
else
PSNU=0
fi
UPNU=$(echo "$STAT_MSG" | cut -c ${OFFSET}- | awk '{print $1}' | grep -w '^Up' | wc -l)
UPNU=$(echo "$PSTAT_MSG" | cut -c ${OFFSET}- | awk '{print $1}' | grep -w '^Up' | wc -l)

if [ "${PSNU:-0}" -ne 0 ]; then
if [ ${UPNU:-0} -eq 0 ]; then
Expand Down