aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/chrony/chrony_stop.sh
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2009-11-04 08:37:07 +0000
committerStefan Schmidt <stefan@datenfreihafen.org>2010-03-27 13:08:34 +0100
commit877814e0206bec838a83f31d42d7868ecf9d8075 (patch)
treea636fd0d3606fe39611985d5aed2b3cdc949a913 /recipes/chrony/chrony_stop.sh
parent6b2f9de0f34d89923bb3990e1708d18c740dcef0 (diff)
downloadopenembedded-877814e0206bec838a83f31d42d7868ecf9d8075.tar.gz
chrony: time synchronization recipe (chronyc and chronyd)
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Diffstat (limited to 'recipes/chrony/chrony_stop.sh')
-rw-r--r--recipes/chrony/chrony_stop.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/recipes/chrony/chrony_stop.sh b/recipes/chrony/chrony_stop.sh
new file mode 100644
index 0000000000..65b8f1fbf1
--- /dev/null
+++ b/recipes/chrony/chrony_stop.sh
@@ -0,0 +1,20 @@
+#! /bin/bash
+
+PROC=`ps | grep chronyd | grep -v grep`;
+
+if [ -n "$PROC" ]; then
+
+ RESULT=`chronyc << ___EOF
+ password opensesame
+ offline
+___EOF`
+
+ RESULT2=`echo $RESULT | grep OK`
+ if [ -n "$RESULT2" ]; then
+ echo 1
+ else
+ echo 0;
+ fi
+else
+ echo -1;
+fi \ No newline at end of file