summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--10-chrony20
1 files changed, 4 insertions, 16 deletions
diff --git a/10-chrony b/10-chrony
index 3e392bc6da70..475a1910bc4f 100644
--- a/10-chrony
+++ b/10-chrony
@@ -6,39 +6,27 @@ STATUS=$2
# Make sure we're always getting the standard response strings
LANG='C'
-# Chrony set-up
CHRONY=/usr/bin/chronyc
-CONFIG=/etc/chrony.conf
-KEYFILE=`grep ^keyfile $CONFIG | sed 's/[^ ]* //' -`
-COMMANDKEY=`grep ^commandkey $CONFIG | sed 's/[^ ]* //' -`
-PASSWORD=`grep ^$COMMANDKEY $KEYFILE | sed 's/.*[^ ] //' -`
STATECMD='nmcli -t --fields STATE g'
-chrony_cmd() {
- echo Chrony going $1.
- exec $CHRONY <<EOF
-password $PASSWORD
-$1
-EOF
-}
case "$STATUS" in
up)
- chrony_cmd online
+ $CHRONY -a online
;;
vpn-up)
- chrony_cmd online
+ $CHRONY -a online
;;
down)
# Check for active interface, take offline if none is active
if [ ! `${STATECMD}` = 'connected' ]; then
- chrony_cmd offline
+ $CHRONY -a offline
fi
;;
vpn-down)
# Check for active interface, take offline if none is active
if [ ! `${STATECMD}` = 'connected' ]; then
- chrony_cmd offline
+ $CHRONY -a offline
fi
;;
esac