From 5751d900209d5f4bfe8d8d6e6775915b8a714548 Mon Sep 17 00:00:00 2001 From: Todd E Johnson Date: Tue, 23 Jul 2019 12:15:39 -0500 Subject: [PATCH] Add checks to see if dbus and NetworkManager are running --- usr/local/sbin/nm-unmetered-connection.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr/local/sbin/nm-unmetered-connection.sh b/usr/local/sbin/nm-unmetered-connection.sh index aa68fd0..dd6cbc2 100644 --- a/usr/local/sbin/nm-unmetered-connection.sh +++ b/usr/local/sbin/nm-unmetered-connection.sh @@ -1,5 +1,8 @@ #!/bin/bash +systemctl is-active dbus.service >/dev/null 2>&1 || exit 0 +systemctl is-active NetworkManager.service >/dev/null 2>&1 || exit 0 + metered_status=$(dbus-send --system --print-reply=literal \ --system --dest=org.freedesktop.NetworkManager \ /org/freedesktop/NetworkManager \