From 5b1503cda88b8095076297fb94fe2ce7316f1564 Mon Sep 17 00:00:00 2001 From: "Brett T. Warden" Date: Wed, 14 Sep 2022 17:12:37 -0700 Subject: [PATCH] Handle newline in response from systemctl is-active --- scripts/clr-network-troubleshooter.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/clr-network-troubleshooter.in b/scripts/clr-network-troubleshooter.in index 5131129..8c6a129 100755 --- a/scripts/clr-network-troubleshooter.in +++ b/scripts/clr-network-troubleshooter.in @@ -423,8 +423,8 @@ sub check_proxies_reachable { log_warning("PAC file not loaded by system"); add_action("Restart pacdiscovery (sudo systemctl restart pacdiscovery)"); } - elsif (`systemctl is-active pacrunner` ne 'active' - || `systemctl is-active pacdiscovery` ne 'active') { + elsif (`systemctl is-active pacrunner` !~ /^active$/ + || `systemctl is-active pacdiscovery` !~ /^active$/) { log_warning("not running: pacrunner and/or pacdiscovery"); add_action("Restart pacdiscovery (sudo systemctl restart pacdiscovery)"); }