Created
July 14, 2012 11:36
-
-
Save antsmartian/3110766 to your computer and use it in GitHub Desktop.
Shell script for syn with ntp servers for proper time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Call the config file . . | |
source configFile.sh | |
#Install ntp on the server | |
sudo apt-get install ntp | |
#The config files for ntp lies in /etc/ntp.conf. | |
#We are changing the Servers time to our nearest geo location. | |
#Look here for more info : http://www.pool.ntp.org/zone/in | |
sed -i "s/server 0.ubuntu.pool.ntp.org/server 1.in.pool.ntp.org/g" /etc/ntp.conf | |
sed -i "s/server 1.ubuntu.pool.ntp.org/server 1.asia.pool.ntp.org/g" /etc/ntp.conf | |
sed -i "s/server 2.ubuntu.pool.ntp.org/server 2.asia.pool.ntp.org/g" /etc/ntp.conf | |
sed -i "s/server 3.ubuntu.pool.ntp.org//g" /etc/ntp.conf | |
#Restart the service. | |
sudo service ntp restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment