From c15c303a87570e7c0fa0377dddfa30d67e48d9ef Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Tue, 15 May 2018 17:15:37 +0000 Subject: [PATCH] Suppress errors if Network manager is not installed --- debian-config-functions | 0 debian-config-functions-network | 0 debian-config-jobs | 0 debian-config-submenu | 8 ++++---- 4 files changed, 4 insertions(+), 4 deletions(-) mode change 100755 => 100644 debian-config-functions mode change 100755 => 100644 debian-config-functions-network mode change 100755 => 100644 debian-config-jobs mode change 100755 => 100644 debian-config-submenu diff --git a/debian-config-functions b/debian-config-functions old mode 100755 new mode 100644 diff --git a/debian-config-functions-network b/debian-config-functions-network old mode 100755 new mode 100644 diff --git a/debian-config-jobs b/debian-config-jobs old mode 100755 new mode 100644 diff --git a/debian-config-submenu b/debian-config-submenu old mode 100755 new mode 100644 index f28ef02..b8a9b93 --- a/debian-config-submenu +++ b/debian-config-submenu @@ -152,7 +152,7 @@ while true; do HOSTAPDCLIENTS=$(hostapd_cli all_sta 2> /dev/null | grep connected_time | wc -l) LIST+=( "Hotspot" "Manage active wireless access point" ) else - [[ -n $(LC_ALL=C nmcli device status | grep wifi | grep -w disconnected) ]] && LIST+=( "Hotspot" "Create WiFi access point" ) + [[ -n $(LC_ALL=C nmcli device status 2> /dev/null | grep wifi | grep -w disconnected) ]] && LIST+=( "Hotspot" "Create WiFi access point" ) fi @@ -166,7 +166,7 @@ while true; do fi fi - if [[ -n $(LC_ALL=C nmcli device status | grep wifi | grep -v unavailable | grep -v unmanaged) ]]; then + if [[ -n $(LC_ALL=C nmcli device status 2> /dev/null | grep wifi | grep -v unavailable | grep -v unmanaged) ]]; then LIST+=( "WiFi" "Manage wireless networking" ) else LIST+=( "Clear" "Clear possible blocked interfaces" ) @@ -192,14 +192,14 @@ while true; do # count number of menu items to adjust window sizee LISTLENGHT="$((12+${#LIST[@]}/2))" BOXLENGHT=${#LIST[@]} - WIFICONNECTED=$(LC_ALL=C nmcli -f NAME,TYPE connection show --active | grep wireless | awk 'NF{NF-=1};1') + WIFICONNECTED=$(LC_ALL=C nmcli -f NAME,TYPE connection show --active 2> /dev/null | grep wireless | awk 'NF{NF-=1};1') local disclaimer="" local ipadd=$(ip -4 addr show dev $DEFAULT_ADAPTER | awk '/inet/ {print $2}' | cut -d'/' -f1) - if [[ -n $(LC_ALL=C nmcli device status | grep $DEFAULT_ADAPTER | grep connected) ]]; then + if [[ -n $(LC_ALL=C nmcli device status 2> /dev/null | grep $DEFAULT_ADAPTER | grep connected) ]]; then local ifup="\nIP ($DEFAULT_ADAPTER) via Network Manager: \Z1${ipadd}\n\Z0 " else if [[ -n $(service systemd-networkd status | grep -w active | grep -w running) ]]; then