From f0d40f28fcfe301331e5c1c60e6db45873b3d8d1 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Sun, 1 Nov 2020 14:14:57 +0100 Subject: [PATCH] Fix for shellcheck problem and whitespace issue as suggested by Reed Wade (also stripping trailing spaces) Signed-off-by: Maarten van Gompel --- scripts/core/sxmo_networks.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/core/sxmo_networks.sh b/scripts/core/sxmo_networks.sh index 771a833..0a58cab 100755 --- a/scripts/core/sxmo_networks.sh +++ b/scripts/core/sxmo_networks.sh @@ -3,7 +3,7 @@ connections() { ACTIVE="$(nmcli -c no -t c show --active | cut -d: -f1,3 | sed 's/$/ ✓/')" INACTIVE="$(nmcli -c no -t c show | cut -d: -f1,3)" - printf %b "$ACTIVE\n$INACTIVE" | sort -u -t: -k1,1 + printf %b "$ACTIVE\n$INACTIVE" | sort -u -t: -k1,1 } toggleconnection() { @@ -54,7 +54,7 @@ addnetworkgsmmenu() { addnetworkwpamenu() { SSID="$( - nmcli d wifi list | tail -n +2 | grep -v '^*' | awk '{ print $2 }' | grep -v '\-\-' | + nmcli d wifi list | tail -n +2 | grep -v '^\*' | awk -F' ' '{ print $6 }' | grep -v '\-\-' | xargs -0 printf 'Close Menu\n%s' | sxmo_dmenu_with_kb.sh -c -p "Add WPA: SSID" -fn "Terminus-20" -l 20 )" @@ -79,7 +79,7 @@ addnetworkwpamenu() { networksmenu() { while true; do CHOICE="$( - printf %b " + printf %b " $(connections) Add a GSM Network Add a WPA Network @@ -88,7 +88,7 @@ networksmenu() { Launch Ifconfig Scan Wifi Networks Close Menu - " | + " | awk '{$1=$1};1' | grep '\w' | dmenu -c -p 'Networks' -l 14 -fn 'Terminus-20' )" if [ "$CHOICE" = "Close Menu" ]; then @@ -115,4 +115,4 @@ if [ $# -gt 0 ]; then "$@" else networksmenu -fi \ No newline at end of file +fi