Created
July 1, 2014 20:36
-
-
Save toddlipcon/f154717c214996ea79b3 to your computer and use it in GitHub Desktop.
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 | |
echo Waiting for NTP sync status | |
start_time=$(cut -f1 -d. /proc/uptime) | |
delta=0 | |
while ntptime | grep UNSYNC ; do | |
now=$(cut -f1 -d. /proc/uptime) | |
delta=$[$now - $start_time] | |
if [ $delta -gt 600 ]; then | |
echo NTP time sync never achieved. Failing build. | |
exit 1 | |
fi | |
echo NTP not yet synchronized after $delta secs... sleeping | |
sleep 5 | |
done | |
echo NTP synchronized after $delta seconds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment