summaryrefslogtreecommitdiffstats
path: root/dehydrated/share/hooks
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2022-04-30 21:26:50 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2022-04-30 21:58:22 +0000
commit315b1680dd533fb94ed7ddde9b8aad2bc738e4b9 (patch)
treeecd166d3a0b566b09aa338a823493fd36ea9a70d /dehydrated/share/hooks
parentAvoid failing if /var/lib/dehydrated/certs doesn't exist in dehydrated fix-pe... (diff)
downloadservice-tools-315b1680dd533fb94ed7ddde9b8aad2bc738e4b9.tar.xz
service-tools-315b1680dd533fb94ed7ddde9b8aad2bc738e4b9.zip
Restarting kresd threads only if at least one exists to support building chroots in dehydrated service-reload hook.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'dehydrated/share/hooks')
-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