summaryrefslogtreecommitdiffstats
path: root/dehydrated/share/hooks/exit_hook.service-reload
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xdehydrated/share/hooks/exit_hook.service-reload23
1 files changed, 13 insertions, 10 deletions
diff --git a/dehydrated/share/hooks/exit_hook.service-reload b/dehydrated/share/hooks/exit_hook.service-reload
index c3fbdc2..ebe2d23 100755
--- a/dehydrated/share/hooks/exit_hook.service-reload
+++ b/dehydrated/share/hooks/exit_hook.service-reload
@@ -37,17 +37,20 @@ do
fi
done
-NUMBER="$(systemctl | grep -c 'kresd@[0-9].service')"
-
-if [ "${NUMBER}" -gt 0 ]
+if service kresd@1 status > /dev/null 2>&1
then
- echo -n " + knot-resolver:"
+ NUMBER="$(systemctl | grep -c 'kresd@[0-9].service')"
+
+ if [ "${NUMBER}" -gt 0 ]
+ then
+ echo -n " + knot-resolver:"
- for NUMBER in $(seq 1 "${NUMBER}")
- do
- echo -n " #${NUMBER}"
- service kresd@${NUMBER} restart
- done
+ for NUMBER in $(seq 1 "${NUMBER}")
+ do
+ echo -n " #${NUMBER}"
+ service kresd@${NUMBER} restart
+ done
- echo " done."
+ echo " done."
+ fi
fi