From 633a22ff3aaa3178253abcba79500d705247fc6b Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 26 Oct 2016 15:34:46 +0200 Subject: [PATCH] automate the template regeneration for provided templates for #46 Unfortunately, we need to reload all subdirs (minus the vendor directory). The "*" matcher is not very clever and cannot be coerced to match sub directories without potentially matching any directories longer than their name, e.g. "Sample*" vs "Sample2". Problem is when these are installed and the templates are wrongly regenerated. In theory this doesn't have any bad side effects, but it may be a potential pitfall to avoid now rather than later. --- Mk/plugins.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Mk/plugins.mk b/Mk/plugins.mk index cac34e282..a7995266d 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -124,6 +124,13 @@ scripts-auto: ${DESTDIR}/$${SCRIPT}; \ done; \ fi + @if [ -d ${.CURDIR}/src/opnsense/service/templates ]; then \ + for FILE in $$(cd ${.CURDIR}/src/opnsense/service/templates && \ + find -s . -mindepth 2 -type d); do \ + echo "/usr/local/sbin/configctl template reload $${FILE#./}" >> \ + ${DESTDIR}/+POST_INSTALL; \ + done; \ + fi install: check @mkdir -p ${DESTDIR}${LOCALBASE}