2010-04-29 13:50:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
SERVERFILE=$SAVEDIR/chrony.servers.$interface
|
|
|
|
|
|
|
|
chrony_config() {
|
|
|
|
rm -f $SERVERFILE
|
|
|
|
if [ "$PEERNTP" != "no" ]; then
|
2012-02-10 16:22:48 +00:00
|
|
|
for server in $new_ntp_servers; do
|
2014-09-11 14:17:22 +00:00
|
|
|
echo "$server ${NTPSERVERARGS:-iburst}" >> $SERVERFILE
|
2012-02-10 16:22:48 +00:00
|
|
|
done
|
|
|
|
/usr/libexec/chrony-helper is-running &&
|
2012-02-15 13:31:46 +00:00
|
|
|
/usr/libexec/chrony-helper add-dhclient-servers &&
|
|
|
|
/usr/libexec/chrony-helper remove-dhclient-servers || :
|
2010-04-29 13:50:56 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
chrony_restore() {
|
|
|
|
if [ -f $SERVERFILE ]; then
|
|
|
|
rm -f $SERVERFILE
|
2012-02-10 16:22:48 +00:00
|
|
|
/usr/libexec/chrony-helper is-running &&
|
|
|
|
/usr/libexec/chrony-helper remove-dhclient-servers || :
|
2010-04-29 13:50:56 +00:00
|
|
|
fi
|
|
|
|
}
|