Skip to content

Instantly share code, notes, and snippets.

@mbeacom
Created June 3, 2016 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbeacom/6bcd9ad7f759fcc9230d0c494735d9bc to your computer and use it in GitHub Desktop.
Save mbeacom/6bcd9ad7f759fcc9230d0c494735d9bc to your computer and use it in GitHub Desktop.
Shell script for ubuntu servers to install NTP, set the NTP preferred servers to North America, and restart the service.
sudo apt-get update && \
sudo apt-get install ntp && \
sudo sed -i 's/ubuntu.pool.ntp.org/north-america.pool.ntp.org/g' /etc/ntp.conf && \
sudo service ntp restart
# One-liner
# sudo apt-get update; sudo apt-get install ntp; sudo sed -i 's/ubuntu.pool.ntp.org/north-america.pool.ntp.org/g' /etc/ntp.conf; sudo service ntp restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment