From f0943e59195cbccf9a6f27e73c7e641ea7a1be5f Mon Sep 17 00:00:00 2001 From: Data Backend account Date: Tue, 15 Feb 2022 09:44:01 +0100 Subject: [PATCH] verbose status check script --- eiger/xbl-daq-24/check_services.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/eiger/xbl-daq-24/check_services.sh b/eiger/xbl-daq-24/check_services.sh index 42cc774..6e3b4c5 100755 --- a/eiger/xbl-daq-24/check_services.sh +++ b/eiger/xbl-daq-24/check_services.sh @@ -1,10 +1,26 @@ #!/bin/bash GREP="std|streamvis" -while getopts g: flag +RESTART="OFF" +STATUS_VERBOSE="OFF" +while getopts g:s: flag do case "${flag}" in g) GREP=${OPTARG};; +# r) RESTART='ON';; + s) STATUS_VERBOSE=${OPTARG};; esac done + +if [ ${STATUS_VERBOSE} = "ON" ]; then + systemctl list-units --type service --all | grep -E ${GREP} | awk '{print $1}' | xargs -I{} systemctl status {} +fi + +#if [ RESTART = "ON" ]; then +# systemctl list-units --type service --all | grep -E ${GREP} | awk '{print $1}' | xargs -I{} systemctl restart {} +#fi + systemctl list-units --type service --all | grep -E ${GREP} | awk 'BEGIN{print "Unit State Status"};$4 ~ /^running$/{print $1,$2,$4}' | column -t + + +