Skip to content

Commit 93624b1

Browse files
⚡️ Validate only if container is down
1 parent e0ca80e commit 93624b1

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

start.sh

+4-8
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,14 @@ containers=`docker ps -f status=running --format "{{.Names}}"`
88
for container in $listOfContainers
99
do
1010

11-
if echo $containers |grep -q $container
11+
if ! (echo $containers |grep -q $container )
1212
then
13-
echo "$container online "
14-
message="Alright! The container $container is up ! \n \n"
15-
else
1613
echo "$container offline"
1714
message="Warning! The container $container is down ! \n \n"
1815

19-
#exit 1
16+
curl -H "Content-Type: application/json" \
17+
-X POST \
18+
-d "{\"username\": \"${username}\", \"content\": \"${message}\"}" $url
2019
fi
21-
curl -H "Content-Type: application/json" \
22-
-X POST \
23-
-d "{\"username\": \"${username}\", \"content\": \"${message}\"}" $url
2420
done
2521
exit 0

0 commit comments

Comments
 (0)