Created
February 9, 2018 10:24
-
-
Save alexellis/4ce511f08313a16d5a945a5ad27b0f25 to your computer and use it in GitHub Desktop.
Sync time and date via curl
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 | |
date -d "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g')" | |
You're welcome. The original script still works for me on Ubuntu, what OS are you using? Did my original version fail for you?
I am using it on Centos 7. Your script is only show the date time but not set.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use it to set date time directly.
-s == set
-d == display
Thank you for your script. It help me