From 4766689dedc2bc68c05abaeccc7f68c4f21cacf3 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 22 Jan 2020 11:37:42 +0100 Subject: [PATCH] #920 detect service dead --- home.admin/config.scripts/bonus.btc-rpc-explorer.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh index f7b319690..e0d486a54 100644 --- a/home.admin/config.scripts/bonus.btc-rpc-explorer.sh +++ b/home.admin/config.scripts/bonus.btc-rpc-explorer.sh @@ -29,6 +29,13 @@ if [ "$1" = "status" ]; then echo "isIndexed=${isIndexed}" echo "indexInfo='${indexInfo}'" + # check for error + isDead=$(sudo systemctl status btc-rpc-explorer | grep -c 'inactive (dead)') + if [ ${isDead} -eq 1 ]; then + echo "error='Service Failed'" + exit 1 + fi + else echo "configured=0" fi