From c79178dea06fa8bebfd4264e9b5e7fd112ebdb35 Mon Sep 17 00:00:00 2001 From: vincent Date: Sun, 5 Jul 2020 12:11:17 +0200 Subject: [PATCH] update check service for container --- script/script/check_service.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/script/script/check_service.sh b/script/script/check_service.sh index 8163463..0a4f8e0 100755 --- a/script/script/check_service.sh +++ b/script/script/check_service.sh @@ -1,4 +1,5 @@ -SERVICES=("syncthing@vincent" "named" "mariadb" "nginx" "php-fpm" "gitea" "tt-rss" "gunicorn-chainetv.socket" "gunicorn-supysonic" "rsyncd.service" "fail2ban" "supysonic-daemon" "home-assistant" "radicale") +SERVICES=("syncthing@vincent" "mariadb" "nginx" "php-fpm" "gitea" "tt-rss" "gunicorn-chainetv.socket" "gunicorn-supysonic" "rsyncd.service" "fail2ban" "supysonic-daemon" "home-assistant" "radicale") +CONTAINER=("pihole") HOST=$(hostname) RED='\033[0;31m' GREEN='\033[0;32m' @@ -21,3 +22,8 @@ do fi echo "" done +for container in ${CONTAINER[@]} +do + status=$(docker ps | grep $container >/dev/null && (echo active) || (echo inactive)) + echo -e "$container is $status" +done