From 8e7ec17828f3519524e2810f6264d7ffca1c002e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 29 Jun 2022 10:09:47 +0200 Subject: [PATCH] dns/ddclient: update for force addition Could be added to GUI, but needs testing first. --- dns/ddclient/Makefile | 3 +-- dns/ddclient/pkg-descr | 5 +++++ .../conf/actions.d/actions_ddclient.conf | 20 ++++++++++++++++--- .../templates/OPNsense/ddclient/ddclient.conf | 1 - .../templates/OPNsense/ddclient/rc.conf.d | 1 + 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/dns/ddclient/Makefile b/dns/ddclient/Makefile index 43b4e3003..2c0b66f55 100644 --- a/dns/ddclient/Makefile +++ b/dns/ddclient/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= ddclient -PLUGIN_VERSION= 1.7 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.8 PLUGIN_DEPENDS= ddclient PLUGIN_COMMENT= Dynamic DNS client PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/dns/ddclient/pkg-descr b/dns/ddclient/pkg-descr index 0464eccab..ff56d64fd 100644 --- a/dns/ddclient/pkg-descr +++ b/dns/ddclient/pkg-descr @@ -6,6 +6,11 @@ WWW: https://github.com/ddclient/ddclient Plugin Changelog ================ +1.8 + +* Add a force action (also available via cron) +* Fix expected permission on ddclient.conf + 1.7 * Add current ip address and updated timestamp to search api and grid 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 d59aaf852..99e5b6b38 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,5 +1,7 @@ [start] -command:/usr/local/etc/rc.d/ddclient start +command: + chmod 600 /usr/local/etc/ddclient.conf; + /usr/local/etc/rc.d/ddclient start type:script message:starting ddclient @@ -14,16 +16,28 @@ type:script_output message:get ddclient status [restart] -command:/usr/local/etc/rc.d/ddclient restart +command: + chmod 600 /usr/local/etc/ddclient.conf; + /usr/local/etc/rc.d/ddclient restart type:script message:restarting ddclient description:Restart ddclient service [reload] -command:/usr/local/etc/rc.d/ddclient reload +command: + chmod 600 /usr/local/etc/ddclient.conf; + /usr/local/etc/rc.d/ddclient reload type:script message:reload ddclient configuration +[force] +command: + chmod 600 /usr/local/etc/ddclient.conf; + /usr/local/sbin/ddclient -force +type:script +message:forcing ddclient update +desciption:Force ddclient update + [statistics] command:/usr/local/opnsense/scripts/ddclient/stats type:script_output diff --git a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf index 27d26193d..8a6b263eb 100644 --- a/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf +++ b/dns/ddclient/src/opnsense/service/templates/OPNsense/ddclient/ddclient.conf @@ -1,5 +1,4 @@ {% from 'OPNsense/Macros/interface.macro' import physical_interface %} -daemon={{OPNsense.DynDNS.general.daemon_delay|default('300')}} syslog=yes # log update msgs to syslog pid=/var/run/ddclient.pid # record PID in file. {% if not helpers.empty('OPNsense.DynDNS.general.verbose') %} 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 c89c76bd5..f4c769756 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') %} ddclient_enable="YES" +ddclient_flags="-daemon {{OPNsense.DynDNS.general.daemon_delay|default('300')}}" {% else %} ddclient_enable="NO" {% endif %}