From: Michael Mrozek Date: Tue, 16 Oct 2012 02:44:08 +0000 (+0200) Subject: op_datetime.sh: Add "Sync to Internet" using ntpdate X-Git-Tag: sz_152~16 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=openpandora.oe.git;a=commitdiff_plain;h=bcac3c7fd1abd8f8e956abd3200ab5d34487bf82 op_datetime.sh: Add "Sync to Internet" using ntpdate --- diff --git a/recipes/pandora-system/pandora-scripts/op_datetime.sh b/recipes/pandora-system/pandora-scripts/op_datetime.sh old mode 100755 new mode 100644 index 09ade72..d704437 --- a/recipes/pandora-system/pandora-scripts/op_datetime.sh +++ b/recipes/pandora-system/pandora-scripts/op_datetime.sh @@ -2,7 +2,7 @@ # Set the timezone and date/time -while mainsel=$(zenity --title="Date / Time / Timezone" --width="400" --height="250" --list --column "id" --column "Please select" --hide-column=1 --text="You can set the time and date or select a different timezone.\n" "td" "Change Time and Date" "tz" "Select Timezone" --ok-label="Change Setting" --cancel-label="Exit"); do +while mainsel=$(zenity --title="Date / Time / Timezone" --width="400" --height="250" --list --column "id" --column "Please select" --hide-column=1 --text="You can set the time and date or select a different timezone.\n" "td" "Change Time and Date" "tz" "Select Timezone" "sync" "Sync time over Internet" --ok-label="Change Setting" --cancel-label="Exit"); do case $mainsel in @@ -61,6 +61,16 @@ case $mainsel in xset s on fi ;; - + "sync") + ( + sudo /etc/init.d/ntpd stop + sudo ntpdate pool.ntp.org + ) | + zenity --progress \ + --title="Syncing..." \ + --text="Syncing with time server...\nPlease wait a while..." \ + --pulsate + sudo /etc/init.d/ntpd start + ;; esac done