Time Script For Beagle Bone Black
03 March, 2015
I wrote this script for dealing with time on the beagle bone black. First run set the timezone to where you live on the 4th line. Any runs after that have the 3rd and 4th lines commented. If the time resets after each time you boot and doesn't automatically change to the correct time you can place this script in the auto run folder in the cloud 9 IDE (save it as time.sh, or whatever you like with a .sh extension. This script doesn't seem to be required for Debian on beagle bone, but other people on Angstom have reported that the time is not updating automatically after rebooting.
#!/bin/bash
#update time
#rm -rf /etc/localtime
#ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
c=0
x=1
while [ $x -ne 0 ]
do
let c=$c+1
if [ $c -gt 10 ]; then
let x=0
fi
ntpdate -b -s -u pool.ntp.org
if [ $ -ne 0 ]; then
sleep 60
else x=0
fi
done