diff options
Diffstat (limited to 'recipes/chrony/chrony_stop.sh')
-rw-r--r-- | recipes/chrony/chrony_stop.sh | 20 |
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 |