summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTroy Engel2014-08-11 22:53:00 +0000
committerFrederik “Freso” S. Olesen2015-07-12 15:26:46 +0200
commit82e6a3c27784a20dd50124708b76eefb4dff2b85 (patch)
tree3fa97d4f765620a172add6e1f76ad219e2c19651
parentbf41f33060b33200aa74ea2247f1c2423a6c9ed9 (diff)
downloadaur-82e6a3c27784a20dd50124708b76eefb4dff2b85.tar.gz
networkmanager-dispatcher-chrony: Use nmcli instead of nm-tool.
> The NetworkManager 0.9.10.0-2 that is in the repository no longer > ships the 'nm-tool' utility, so this script is also broken in that > area. It can be replaced by "nmcli -t --fields STATE g" easily: > > STATECMD="nmcli -t --fields STATE g" > [...] > if [ ! `${STATECMD}` = 'connected' ]; then > [...] > > This fix plus the PASSWORD one now results in a fully working > dispatcher with the latest NM release.
-rw-r--r--10-chrony5
1 files changed, 3 insertions, 2 deletions
diff --git a/10-chrony b/10-chrony
index 626ef9a48c30..e5603ddec844 100644
--- a/10-chrony
+++ b/10-chrony
@@ -9,6 +9,7 @@ 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.
@@ -27,13 +28,13 @@ case "$STATUS" in
;;
down)
# Check for active interface, take offline if none is active
- if [ ! `nm-tool|grep State|cut -f2 -d' '` = 'connected' ]; then
+ if [ ! `${STATECMD}` = 'connected' ]; then
chrony_cmd offline
fi
;;
vpn-down)
# Check for active interface, take offline if none is active
- if [ ! `nm-tool|grep State|cut -f2 -d' '` = 'connected' ]; then
+ if [ ! `${STATECMD}` = 'connected' ]; then
chrony_cmd offline
fi
;;