Skip to content

Instantly share code, notes, and snippets.

@alexellis
Created February 9, 2018 10:24
Show Gist options
  • Save alexellis/4ce511f08313a16d5a945a5ad27b0f25 to your computer and use it in GitHub Desktop.
Save alexellis/4ce511f08313a16d5a945a5ad27b0f25 to your computer and use it in GitHub Desktop.
Sync time and date via curl
#!/bin/bash
date -d "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g')"
@alexellis
Copy link
Author

You're welcome. The original script still works for me on Ubuntu, what OS are you using? Did my original version fail for you?

@cnjax
Copy link

cnjax commented Dec 19, 2019

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