ntp-4.2.4p7: make it possible to call hwclock from ntpdate if-up.d script
authorJeremy Lainé <jeremy.laine@m4x.org>
Tue, 3 Nov 2009 17:31:14 +0000 (18:31 +0100)
committerJeremy Lainé <jeremy.laine@m4x.org>
Tue, 3 Nov 2009 17:31:14 +0000 (18:31 +0100)
recipes/ntp/ntp-4.2.4p7/ntpdate

index 5b139ed..784b029 100755 (executable)
@@ -35,7 +35,11 @@ if [ -x /usr/bin/lockfile-create ]; then
        LOCKTOUCHPID="$!"
 fi
 
-/usr/bin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null || :
+if /usr/bin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then
+       if [ "$UPDATE_HWCLOCK" = "yes" ]; then
+               hwclock --systohc || :
+       fi
+fi
 
 if [ -x /usr/bin/lockfile-create ] ; then
        kill $LOCKTOUCHPID