pandora-skel: Add script that automatically does ntpdate whenever NetworkManager...
authorMichael Mrozek <EvilDragon@openpandora.org>
Sat, 7 Dec 2013 03:18:52 +0000 (04:18 +0100)
committerMichael Mrozek <EvilDragon@openpandora.org>
Sat, 7 Dec 2013 03:18:52 +0000 (04:18 +0100)
recipes/pandora-system/pandora-skel.bb
recipes/pandora-system/pandora-skel/ntpdate.sh [new file with mode: 0644]

index 3b85dca..d0d4030 100644 (file)
@@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora"
 # /etc/skel is used by Shadow's useradd so you really have that installed for this to make sense ;)
 RDEPENDS = "shadow"
 
-PR = "r22"
+PR = "r23"
 
 SRC_URI = " \
   file://.xinitrc \     
@@ -32,6 +32,9 @@ do_install() {
   install -d ${D}${sysconfdir}/skel/Desktop
   install -d ${D}${sysconfdir}/modutils/
   install -d ${D}${sysconfdir}/pandora/
+  install -d ${D}${sysconfdir}/NetworkManager/
+  install -d ${D}${sysconfdir}/NetworkManager/dispatcher.d/
+  install -m 0755 ${WORKDIR}/ntpdate.sh  ${D}${sysconfdir}/NetworkManager/dispatcher.d/ntpdate.sh
   install -m 0644 ${WORKDIR}/.xinitrc ${D}${sysconfdir}/skel/.xinitrc
   install -m 0644 ${WORKDIR}/vimrc ${D}${sysconfdir}/skel/.vimrc
   install -m 0644 ${WORKDIR}/bashrc ${D}${sysconfdir}/skel/.bashrc
diff --git a/recipes/pandora-system/pandora-skel/ntpdate.sh b/recipes/pandora-system/pandora-skel/ntpdate.sh
new file mode 100644 (file)
index 0000000..c0a09da
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+# Sync time via ntp whenever NetworkManager connects
+
+case "$2" in
+    up)
+     ntpdate pool.ntp.org
+     ;;
+     *)
+     ;;
+esac