diff --git a/Mk/plugins.mk b/Mk/plugins.mk index 4736b80ed..cb303a0b0 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -129,14 +129,18 @@ scripts-auto: done; \ fi @if [ -d ${.CURDIR}/src/opnsense/mvc/app/models ]; then \ - cat ${TEMPLATESDIR}/models >> ${DESTDIR}/+POST_INSTALL; \ + for FILE in $$(cd ${.CURDIR}/src/opnsense/service/templates && \ + find -s . -mindepth 2 -type d); do \ + cat ${TEMPLATESDIR}/models | \ + sed "s:%%ARG%%:$${FILE#./}:g" >> \ + ${DESTDIR}/+POST_INSTALL; \ + 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 "echo -n \"Reloading template $${FILE#./}: \"" >> \ - ${DESTDIR}/+POST_INSTALL; \ - echo "/usr/local/sbin/configctl template reload $${FILE#./}" >> \ + cat ${TEMPLATESDIR}/templates | \ + sed "s:%%ARG%%:$${FILE#./}:g" >> \ ${DESTDIR}/+POST_INSTALL; \ done; \ fi diff --git a/Templates/models b/Templates/models index 0ea75f82d..a33507559 100644 --- a/Templates/models +++ b/Templates/models @@ -1,2 +1,2 @@ -echo "Running migration" -/usr/local/opnsense/mvc/script/run_migrations.php +echo "Migrating %%ARG%%" +/usr/local/opnsense/mvc/script/run_migrations.php %%ARG%% diff --git a/Templates/templates b/Templates/templates new file mode 100644 index 000000000..636ea1374 --- /dev/null +++ b/Templates/templates @@ -0,0 +1,2 @@ +echo -n "Reloading template %%ARG%%: " +/usr/local/sbin/configctl template reload %%ARG%%