From 0e0ff854dbbdba8ea57b6d190acc7b66a9d57605 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 27 Nov 2023 11:36:06 +0100 Subject: [PATCH] dns/ddclient: more changes for a full 1.18; also closes #3685 --- dns/ddclient/Makefile | 2 +- dns/ddclient/pkg-descr | 6 ++++++ .../src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml | 6 ++---- dns/ddclient/src/opnsense/scripts/ddclient/setup.sh | 5 +++++ .../opnsense/service/conf/actions.d/actions_ddclient.conf | 7 ++----- .../templates/OPNsense/ddclient/ddclient_opn.rc.conf.d | 1 + .../opnsense/service/templates/OPNsense/ddclient/rc.conf.d | 1 + 7 files changed, 18 insertions(+), 10 deletions(-) create mode 100755 dns/ddclient/src/opnsense/scripts/ddclient/setup.sh diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index f21eeef03..b01fe14d4 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.17 +PLUGIN_VERSION= 1.18 PLUGIN_DEPENDS= ddclient py${PLUGIN_PYTHON}-boto3 PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index f06c77db0..434055d29 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,12 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.18 + +* Update to ddclient 3.11.2 FreeBSD ports version +* Default to native backend for new installs +* Fix permission of ddclient.json + 1.17 * Update to ddclient 3.11.1 (dnsexit legacy support removed) diff --git a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml index 7104462f0..a3ae3beae 100644 --- a/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml +++ b/dns/ddclient/src/opnsense/mvc/app/models/OPNsense/DynDNS/DynDNS.xml @@ -1,9 +1,7 @@ //OPNsense/DynDNS 1.5.1 - - Dynamic DNS client - + Dynamic DNS client @@ -26,7 +24,7 @@ Y - ddclient + opnsense A backend is required. ddclient diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/setup.sh b/dns/ddclient/src/opnsense/scripts/ddclient/setup.sh new file mode 100755 index 000000000..7cf7b8d4a --- /dev/null +++ b/dns/ddclient/src/opnsense/scripts/ddclient/setup.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +for CONF in /usr/local/etc/ddclient.conf /usr/local/etc/ddclient.json; do + chmod 0600 ${CONF} +done diff --git a/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf b/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf index ce63a7ef8..8500bfa48 100644 --- a/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf +++ b/dns/ddclient/src/opnsense/service/conf/actions.d/actions_ddclient.conf @@ -1,7 +1,6 @@ [start] command: - chmod 600 /usr/local/etc/ddclient.conf; - /usr/local/etc/rc.d/ddclient start ; + /usr/local/etc/rc.d/ddclient start; /usr/local/etc/rc.d/ddclient_opn start type:script message:starting ddclient @@ -18,9 +17,8 @@ message:get ddclient status [restart] command: - chmod 600 /usr/local/etc/ddclient.conf; pkill -F /var/run/ddclient.pid 2> /dev/null; - /usr/local/etc/rc.d/ddclient restart ; + /usr/local/etc/rc.d/ddclient restart; /usr/local/etc/rc.d/ddclient_opn restart type:script message:restarting ddclient @@ -28,7 +26,6 @@ description:Restart ddclient service [force] command: - chmod 600 /usr/local/etc/ddclient.conf; rm /var/tmp/ddclient_opn.status 2>/dev/null; /usr/local/etc/rc.d/ddclient_opn restart 2>/dev/null; /usr/local/sbin/ddclient -force diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient_opn.rc.conf.d b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient_opn.rc.conf.d index df8079f83..b6a9cf014 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient_opn.rc.conf.d +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient_opn.rc.conf.d @@ -1,5 +1,6 @@ {% if not helpers.empty('OPNsense.DynDNS.general.enabled') and OPNsense.DynDNS.general.backend == 'opnsense' %} ddclient_opn_enable="YES" +ddclient_opn_setup="/usr/local/opnsense/scripts/ddclient/setup.sh" {% else %} ddclient_opn_enable="NO" {% endif %} diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d index dae5683f0..ecb315a71 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/rc.conf.d @@ -1,5 +1,6 @@ {% if not helpers.empty('OPNsense.DynDNS.general.enabled') and OPNsense.DynDNS.general.backend == 'ddclient' %} ddclient_enable="YES" +ddclient_setup="/usr/local/opnsense/scripts/ddclient/setup.sh" ddclient_flags="-daemon {{OPNsense.DynDNS.general.daemon_delay|default('300')}}" {% else %} ddclient_enable="NO"