aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/chrony/chrony_start.sh
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/chrony/chrony_start.sh')
-rw-r--r--recipes/chrony/chrony_start.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/recipes/chrony/chrony_start.sh b/recipes/chrony/chrony_start.sh
new file mode 100644
index 0000000000..e50a3a4828
--- /dev/null
+++ b/recipes/chrony/chrony_start.sh
@@ -0,0 +1,20 @@
+#! /bin/bash
+
+PROC=`ps | grep chronyd | grep -v grep`;
+
+if [ -n "$PROC" ]; then
+
+ RESULT=`chronyc << ___EOF
+ password opensesame
+ online
+___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