From 7f04710579ef9466bc429403624fed71f112d6c9 Mon Sep 17 00:00:00 2001 From: Glen Huang Date: Sat, 22 Oct 2022 22:17:08 +0800 Subject: amce: use procd to restart services Directly calling `/etc/init.d/ reload` in a hotplug script can inadvertently start a stopped service. Signed-off-by: Glen Huang --- net/acme-common/files/acme-notify.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 net/acme-common/files/acme-notify.sh (limited to 'net/acme-common/files/acme-notify.sh') diff --git a/net/acme-common/files/acme-notify.sh b/net/acme-common/files/acme-notify.sh new file mode 100644 index 000000000..4f06f9412 --- /dev/null +++ b/net/acme-common/files/acme-notify.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -u + +event="$1" + +# Call hotplug first, giving scripts a chance to modify certificates before +# reloadaing the services +ACTION=$event hotplug-call acme + +case $event in +renewed) + ubus call service event '{"type":"acme.renew","data":{}}' + ;; +issued) + ubus call service event '{"type":"acme.issue","data":{}}' + ;; +esac -- cgit v1.2.3