8a7337
#!/bin/bash
8a7337
8a7337
SERVERFILE=$SAVEDIR/chrony.servers.$interface
8a7337
8a7337
chrony_config() {
b94f58
	# Disable modifications if called from a NM dispatcher script
b94f58
	[ -n "$NM_DISPATCHER_ACTION" ] && return 0
b94f58
8a7337
	rm -f "$SERVERFILE"
8a7337
	if [ "$PEERNTP" != "no" ]; then
8a7337
		for server in $new_ntp_servers; do
8a7337
			echo "$server ${NTPSERVERARGS:-iburst}" >> "$SERVERFILE"
8a7337
		done
8a7337
		/usr/libexec/chrony-helper update-daemon || :
8a7337
	fi
8a7337
}
8a7337
8a7337
chrony_restore() {
b94f58
	[ -n "$NM_DISPATCHER_ACTION" ] && return 0
b94f58
8a7337
	if [ -f "$SERVERFILE" ]; then
8a7337
		rm -f "$SERVERFILE"
8a7337
		/usr/libexec/chrony-helper update-daemon || :
8a7337
	fi
8a7337
}