25 lines
547 B
Bash
25 lines
547 B
Bash
#!/bin/bash
|
|
|
|
SERVERFILE=$SAVEDIR/chrony.servers.$interface
|
|
|
|
chrony_config() {
|
|
rm -f $SERVERFILE
|
|
if [ "$PEERNTP" != "no" ]; then
|
|
/usr/libexec/chrony-helper command "$(
|
|
for server in $new_ntp_servers; do
|
|
echo "add server $server $NTPSERVERARGS"
|
|
echo "$server $NTPSERVERARGS" >> $SERVERFILE
|
|
done)" &> /dev/null
|
|
fi
|
|
}
|
|
|
|
chrony_restore() {
|
|
if [ -f $SERVERFILE ]; then
|
|
/usr/libexec/chrony-helper command "$(
|
|
while read server serverargs; do
|
|
echo "delete $server"
|
|
done < $SERVERFILE)" &> /dev/null
|
|
rm -f $SERVERFILE
|
|
fi
|
|
}
|