Skip to content

Instantly share code, notes, and snippets.

@song940
Last active August 29, 2015 14:04
Show Gist options
  • Save song940/c57ee378c30e99a7cf51 to your computer and use it in GitHub Desktop.
Save song940/c57ee378c30e99a7cf51 to your computer and use it in GitHub Desktop.
#!/bin/bash
/etc/init.d/ntp stop
until ping -nq -c3 8.8.8.8 > /dev/null; do
echo "Waiting for network..."
done
ntpdate -s time.nist.gov
/etc/init.d/ntp start
echo "Time now : `date`"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment