2010-04-29 13:50:56 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
SERVERFILE=$SAVEDIR/chrony.servers.$interface
|
|
|
|
|
|
|
|
chrony_config() {
|
|
|
|
rm -f $SERVERFILE
|
|
|
|
if [ "$PEERNTP" != "no" ]; then
|
2011-06-24 13:36:06 +00:00
|
|
|
/usr/libexec/chrony-helper command "$(
|
2010-04-29 13:50:56 +00:00
|
|
|
for server in $new_ntp_servers; do
|
|
|
|
echo "add server $server $NTPSERVERARGS"
|
|
|
|
echo "$server $NTPSERVERARGS" >> $SERVERFILE
|
2012-02-10 16:13:20 +00:00
|
|
|
done)" &> /dev/null || :
|
2010-04-29 13:50:56 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
chrony_restore() {
|
|
|
|
if [ -f $SERVERFILE ]; then
|
2011-06-24 13:36:06 +00:00
|
|
|
/usr/libexec/chrony-helper command "$(
|
2010-04-29 13:50:56 +00:00
|
|
|
while read server serverargs; do
|
|
|
|
echo "delete $server"
|
|
|
|
done < $SERVERFILE)" &> /dev/null
|
|
|
|
rm -f $SERVERFILE
|
|
|
|
fi
|
|
|
|
}
|