[Frugalware-git] frugalware-current: networkmanager-dispatcher-chrony-20151210-1-x86_64

DeX77 dex77 at frugalware.org
Thu Dec 10 10:48:33 CET 2015


Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=88bd36b8c5a9ad0b14f542ac0df89a5ebfb618d5

commit 88bd36b8c5a9ad0b14f542ac0df89a5ebfb618d5
Author: DeX77 <dex77 at frugalware.org>
Date:   Thu Dec 10 10:48:42 2015 +0100

networkmanager-dispatcher-chrony-20151210-1-x86_64

* version bump

diff --git a/source/network-extra/networkmanager-dispatcher-chrony/10-chrony b/source/network-extra/networkmanager-dispatcher-chrony/10-chrony
index b3581c5..eb5fad1 100644
--- a/source/network-extra/networkmanager-dispatcher-chrony/10-chrony
+++ b/source/network-extra/networkmanager-dispatcher-chrony/10-chrony
@@ -3,19 +3,18 @@
INTERFACE=$1
STATUS=$2

-# 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/[^ ]* //' -`
+# Make sure we're always getting the standard response strings
+LANG='C'
+
+CHRONY=$(which chronyc)

chrony_cmd() {
-	echo Chrony going $1.
-	exec $CHRONY <<EOF
-password $PASSWORD
-$1
-EOF
+  echo "Chrony going $1."
+  exec $CHRONY -a $1
+}
+
+nm_connected() {
+  [ "$(nmcli -t --fields STATE g)" = 'connected' ]
}

case "$STATUS" in
@@ -27,15 +26,10 @@ case "$STATUS" in
;;
down)
# Check for active interface, take offline if none is active
-    if [ ! `LC_ALL=C nmcli -t -f state g` = 'connected' ]; then
-      chrony_cmd offline
-    fi
+    nm_connected || chrony_cmd offline
;;
vpn-down)
# Check for active interface, take offline if none is active
-    if [ ! `LC_ALL=C nmcli -t -f state g' '` = 'connected' ]; then
-      chrony_cmd offline
-    fi
+    nm_connected || chrony_cmd offline
;;
esac
-
diff --git a/source/network-extra/networkmanager-dispatcher-chrony/FrugalBuild b/source/network-extra/networkmanager-dispatcher-chrony/FrugalBuild
index d408e47..e64c8ed 100644
--- a/source/network-extra/networkmanager-dispatcher-chrony/FrugalBuild
+++ b/source/network-extra/networkmanager-dispatcher-chrony/FrugalBuild
@@ -2,8 +2,8 @@
# Maintainer: DeX77 <dex77 at frugalware.org>

pkgname=networkmanager-dispatcher-chrony
-pkgver=20140728
-pkgrel=2
+pkgver=20151210
+pkgrel=1
pkgdesc="Dispatcher Script for chrony"
url="http://www.gnome.org/projects/NetworkManager"
rodepends=('networkmanager' 'chrony')
@@ -13,7 +13,7 @@ archs=('i686' 'x86_64')
options=('noversrc')
up2date=$pkgver
source=("10-chrony")
-sha1sums=('585c3d1b12153a575f0af094884eded90f528793')
+sha1sums=('73f491b5a2e769f6241d97fe6ae36e540e47fb5b')

build() {
Fmkdir etc/NetworkManager/dispatcher.d/


More information about the Frugalware-git mailing list