Projects
home:Eustace:branches:Eulaceura:Factory
chrony
_service:obs_scm:chrony-nm-dispatcher-dhcp.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:chrony-nm-dispatcher-dhcp.patch of Package chrony
From: Robert Fairley <rfairley@redhat.com> Date: Wed, 17 Jun 2020 10:14:19 -0400 Subject: [PATCH] examples/nm-dispatcher.dhcp: use sysconfig Use the PEERNTP and NTPSERVERARGS environment variables from /etc/sysconfig/network{-scripts}. Co-Authored-By: Christian Glombek <cglombek@redhat.com> --- examples/chrony.nm-dispatcher.dhcp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/chrony.nm-dispatcher.dhcp b/examples/chrony.nm-dispatcher.dhcp index 547ce83..f23756e 100644 --- a/examples/chrony.nm-dispatcher.dhcp +++ b/examples/chrony.nm-dispatcher.dhcp @@ -10,13 +10,21 @@ action=$2 chronyc=/usr/bin/chronyc server_options=iburst -server_dir=/var/run/chrony-dhcp +server_dir=/run/chrony-dhcp dhcp_server_file=$server_dir/$interface.sources dhcp_ntp_servers="$DHCP4_NTP_SERVERS $DHCP6_DHCP6_NTP_SERVERS" +[ -f /etc/sysconfig/network ] && . /etc/sysconfig/network +[ -f /etc/sysconfig/network-scripts/ifcfg-"${interface}" ] && \ + . /etc/sysconfig/network-scripts/ifcfg-"${interface}" + add_servers_from_dhcp() { rm -f "$dhcp_server_file" + + # Don't add NTP servers if PEERNTP=no specified; return early. + [ "$PEERNTP" = "no" ] && return + for server in $dhcp_ntp_servers; do # Check for invalid characters (from the DHCPv6 NTP FQDN suboption) len1=$(printf '%s' "$server" | wc -c) @@ -25,7 +33,7 @@ add_servers_from_dhcp() { continue fi - printf 'server %s %s\n' "$server" "$server_options" >> "$dhcp_server_file" + printf 'server %s %s\n' "$server" "${NTPSERVERARGS:-$server_options}" >> "$dhcp_server_file" done $chronyc reload sources > /dev/null 2>&1 || : } -- 2.23.0
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2