op_datetime.sh: Only stop / start ntpd if installed
authorMichael Mrozek <EvilDragon@openpandora.org>
Tue, 16 Oct 2012 11:58:29 +0000 (13:58 +0200)
committerMichael Mrozek <EvilDragon@openpandora.org>
Tue, 16 Oct 2012 12:02:38 +0000 (14:02 +0200)
recipes/pandora-system/pandora-scripts/op_datetime.sh

index d704437..2d301af 100644 (file)
@@ -63,14 +63,14 @@ case $mainsel in
   ;;
   "sync")
   (
-  sudo /etc/init.d/ntpd stop
+  test -e /etc/init.d/ntpd && 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
+  test -e /etc/init.d/ntpd && sudo /etc/init.d/ntpd start
   ;;
 esac
 done