You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
658 B
28 lines
658 B
1 month ago
|
#!/bin/bash
|
||
|
|
||
|
CHRONY_SOURCEDIR=/run/chrony-dhcp
|
||
|
SERVERFILE=$CHRONY_SOURCEDIR/$interface.sources
|
||
|
|
||
|
chrony_config() {
|
||
|
# Disable modifications if called from a NM dispatcher script
|
||
|
[ -n "$NM_DISPATCHER_ACTION" ] && return 0
|
||
|
|
||
|
rm -f "$SERVERFILE"
|
||
|
if [ "$PEERNTP" != "no" ]; then
|
||
|
mkdir -p $CHRONY_SOURCEDIR
|
||
|
for server in $new_ntp_servers; do
|
||
|
echo "server $server ${NTPSERVERARGS:-iburst}" >> "$SERVERFILE"
|
||
|
done
|
||
|
/usr/bin/chronyc reload sources > /dev/null 2>&1 || :
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
chrony_restore() {
|
||
|
[ -n "$NM_DISPATCHER_ACTION" ] && return 0
|
||
|
|
||
|
if [ -f "$SERVERFILE" ]; then
|
||
|
rm -f "$SERVERFILE"
|
||
|
/usr/bin/chronyc reload sources > /dev/null 2>&1 || :
|
||
|
fi
|
||
|
}
|