Fix for shellcheck problem and whitespace issue as suggested by Reed Wade (also stripping trailing spaces)

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
master
Maarten van Gompel 4 years ago
parent 0f685fa3a4
commit f0d40f28fc
  1. 10
      scripts/core/sxmo_networks.sh

@ -3,7 +3,7 @@
connections() { connections() {
ACTIVE="$(nmcli -c no -t c show --active | cut -d: -f1,3 | sed 's/$/ ✓/')" 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)" 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() { toggleconnection() {
@ -54,7 +54,7 @@ addnetworkgsmmenu() {
addnetworkwpamenu() { addnetworkwpamenu() {
SSID="$( 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' | xargs -0 printf 'Close Menu\n%s' |
sxmo_dmenu_with_kb.sh -c -p "Add WPA: SSID" -fn "Terminus-20" -l 20 sxmo_dmenu_with_kb.sh -c -p "Add WPA: SSID" -fn "Terminus-20" -l 20
)" )"
@ -79,7 +79,7 @@ addnetworkwpamenu() {
networksmenu() { networksmenu() {
while true; do while true; do
CHOICE="$( CHOICE="$(
printf %b " printf %b "
$(connections) $(connections)
Add a GSM Network Add a GSM Network
Add a WPA Network Add a WPA Network
@ -88,7 +88,7 @@ networksmenu() {
Launch Ifconfig Launch Ifconfig
Scan Wifi Networks Scan Wifi Networks
Close Menu Close Menu
" | " |
awk '{$1=$1};1' | grep '\w' | dmenu -c -p 'Networks' -l 14 -fn 'Terminus-20' awk '{$1=$1};1' | grep '\w' | dmenu -c -p 'Networks' -l 14 -fn 'Terminus-20'
)" )"
if [ "$CHOICE" = "Close Menu" ]; then if [ "$CHOICE" = "Close Menu" ]; then
@ -115,4 +115,4 @@ if [ $# -gt 0 ]; then
"$@" "$@"
else else
networksmenu networksmenu
fi fi

Loading…
Cancel
Save