I have a script that sets two time servers on our Macs so they can reach one while they are in the office and one while they are out of the office as we do not allow access to the apple time server while in the office. It worked fine on Sierra but stoped working on High Sierra. I think it is not letting the ntp.conf file be written to in High Sierra.
Anyone know of another way to do it in High Sierra?
Here is the script.
Primary Time server for MyCompany Macs
TimeServer1=time.mycompany.com
Secondary Time Server for My Company Macs, used outside of The Company network
TimeServer2=time.apple.com
Set the primary network server with systemsetup -setnetworktimeserver
Using this command will clear /etc/ntp.conf of existing entries and
add the primary time server as the first line.
/usr/sbin/systemsetup -setnetworktimeserver $TimeServer1
Add the tertiary time server as the second line in /etc/ntp.conf
echo "server $TimeServer2" >> /etc/ntp.conf
Start Syncing Time with NetworkTime Server
/usr/sbin/systemsetup -setusingnetworktime On

