import files

This commit is contained in:
Yann Autissier
2021-02-09 17:05:00 +01:00
parent f5c4576411
commit 44a6d37ba5
425 changed files with 23195 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
# https://github.com/hashicorp/consul/issues/3182
if [ $# -ne 1 ]; then
>&2 echo "Invalid parameters: '$@'"
echo "USAGE: $0 <container-id|container-name|container-hostname|container-ip>"
exit 2
fi
CONTAINER_ID="$1"
# CONTAINER_STATUS=$(sudo container-list-status |awk '/\<'${CONTAINER_ID}'\>/ {print $NF}')
read -d "\n" CONTAINER_STATUS CONTAINER_OUTPUT <<< $(sudo container-list-status |awk 'BEGIN {FS="\t"; RS="\0"} /\<'${CONTAINER_ID}'\>/ {print $1,$NF}')
echo ${CONTAINER_STATUS:-undefined}: "${CONTAINER_OUTPUT}"
case "${CONTAINER_STATUS}" in
healthy)
exit 0
;;
starting)
exit 1
;;
esac
exit 2