Blame SOURCES/chrony.dhclient

d45484
#!/bin/bash
d45484
d45484
CHRONY_SOURCEDIR=/run/chrony-dhcp
d45484
SERVERFILE=$CHRONY_SOURCEDIR/$interface.sources
d45484
d45484
chrony_config() {
d45484
	# Disable modifications if called from a NM dispatcher script
d45484
	[ -n "$NM_DISPATCHER_ACTION" ] && return 0
d45484
d45484
	rm -f "$SERVERFILE"
d45484
	if [ "$PEERNTP" != "no" ]; then
d45484
		mkdir -p $CHRONY_SOURCEDIR
d45484
		for server in $new_ntp_servers; do
d45484
			echo "server $server ${NTPSERVERARGS:-iburst}" >> "$SERVERFILE"
d45484
		done
d45484
		/usr/bin/chronyc reload sources > /dev/null 2>&1 || :
d45484
	fi
d45484
}
d45484
d45484
chrony_restore() {
d45484
	[ -n "$NM_DISPATCHER_ACTION" ] && return 0
d45484
d45484
	if [ -f "$SERVERFILE" ]; then
d45484
		rm -f "$SERVERFILE"
d45484
		/usr/bin/chronyc reload sources > /dev/null 2>&1 || :
d45484
	fi
d45484
}