- Config dir /etc/dnsupdate
- Default config /etc/dnsupdate/dnsupdate.cfg
- Per interface config eg /etc/dnsupdate/ppp0.iface
This commit is contained in:
2021-09-17 14:23:49 +02:00
parent 15b072f184
commit e13f31ae8b
3 changed files with 30 additions and 8 deletions

View File

@@ -384,15 +384,29 @@ function update_iface() {
return 1 return 1
fi fi
if [ -f /etc/sysconfig/network ]; then
. /etc/sysconfig/network
fi
# Load global config if exists
[ -f /etc/dnsupdate/dnsupdate.cfg ] && . /etc/dnsupdate/dnsupdate.cfg
# Load distro global config if exists
[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network [ -f /etc/sysconfig/network ] && . /etc/sysconfig/network
[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network if [ -f /etc/sysconfig/network-scripts/network-functions ]; then
. /etc/sysconfig/network-scripts/network-functions
# Load interface config
CONFIG="${1}"
need_config ${CONFIG}
source_config >/dev/null 2>&1
fi
# Load interface config # Load dnsupdate interface specific config if exists
cd /etc/sysconfig/network-scripts if [ -f /etc/dnsupdate/${1}.iface ]; then
CONFIG="${1}" [ "x${DDNS_DEBUG}x" != "xnox" ] && echo "Using config /etc/dnsupdate/${1}.iface"
need_config ${CONFIG} . /etc/dnsupdate/${1}.iface
source_config >/dev/null 2>&1 fi
if [ "x${DDNS}x" == "xnox" ] ; then if [ "x${DDNS}x" == "xnox" ] ; then
return 0 return 0

5
dnsupdate.cfg Normal file
View File

@@ -0,0 +1,5 @@
# Disable DDNS for all interfaces. You can enable it for specific interface.
DDNS=no
# Enable for debugging (default: no)
DDNS_DEBUG=no

View File

@@ -1,13 +1,12 @@
Summary: Dynamic DNS for ppp and dhclient Summary: Dynamic DNS for ppp and dhclient
Name: dnsupdate Name: dnsupdate
Version: 0.6.0 Version: 0.8.0
Release: 1%{?dist} Release: 1%{?dist}
License: GPLv2+ License: GPLv2+
Group: System Environment/Daemons Group: System Environment/Daemons
URL: http://netst.org/pub/fedora/st/ URL: http://netst.org/pub/fedora/st/
BuildArch: noarch BuildArch: noarch
Requires: initscripts
Requires: ppp Requires: ppp
Requires: bind-utils Requires: bind-utils
@@ -16,6 +15,7 @@ Source1: dhclient-dnsupdate.sh
Source2: ppp-dnsupdate.sh Source2: ppp-dnsupdate.sh
Source3: dnsupdate.cron Source3: dnsupdate.cron
Source4: nm-dnsupdate.sh Source4: nm-dnsupdate.sh
Source5: dnsupdate.cfg
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -28,6 +28,7 @@ Dynamic DNS for ppp and dhclient.
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir} install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.d install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/cron.d
install -dm 755 $RPM_BUILD_ROOT%{_bindir} install -dm 755 $RPM_BUILD_ROOT%{_bindir}
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/dnsupdate/
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/ install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d
install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/ppp install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/ppp
@@ -39,6 +40,7 @@ install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/dhcp/dhclient.d/dnsupda
install -pm 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/ppp/ip-up.d/dnsupdate.sh install -pm 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/ppp/ip-up.d/dnsupdate.sh
install -pm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/dnsupdate install -pm 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/cron.d/dnsupdate
install -pm 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d install -pm 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatcher.d
install -pm 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/dnsupdate/dnsupdate.cfg
%clean %clean
%{__rm} -rf %{buildroot} %{__rm} -rf %{buildroot}
@@ -52,6 +54,7 @@ install -pm 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/NetworkManager/dispatch
%{_sysconfdir}/dhcp/dhclient.d/dnsupdate.sh %{_sysconfdir}/dhcp/dhclient.d/dnsupdate.sh
%{_sysconfdir}/ppp/ip-up.d/dnsupdate.sh %{_sysconfdir}/ppp/ip-up.d/dnsupdate.sh
%{_sysconfdir}/cron.d/dnsupdate %{_sysconfdir}/cron.d/dnsupdate
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/dnsupdate/dnsupdate.cfg
%changelog %changelog
* Mon Jul 27 2015 Zoran Pericic <zpericic@netst.org> - 0.5.2-1 * Mon Jul 27 2015 Zoran Pericic <zpericic@netst.org> - 0.5.2-1