From 3be09f89cf1589996d228bb86a9f061d19b838f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C5=9Be=20Fernando=20Moyano?= Date: Fri, 26 Oct 2018 00:33:52 +0200 Subject: [PATCH] Remove "\r" and "\n" from captured SSIDs strings. It was causing problems in ZynthianOS, avoiding to correctly detect the configured Wifi networks and always running up the wifi hotspot. --- src/modules/auto-hotspot/filesystem/root/usr/bin/autohotspotN | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/auto-hotspot/filesystem/root/usr/bin/autohotspotN b/src/modules/auto-hotspot/filesystem/root/usr/bin/autohotspotN index d3b73c22..4d5c9fef 100755 --- a/src/modules/auto-hotspot/filesystem/root/usr/bin/autohotspotN +++ b/src/modules/auto-hotspot/filesystem/root/usr/bin/autohotspotN @@ -19,7 +19,7 @@ wifidev="wlan0" #device name to use. Default is wlan0. IFSdef=$IFS cnt=0 #These four lines capture the wifi networks the RPi is setup to use -wpassid=$(awk '/ssid="/{ print $0 }' /etc/wpa_supplicant/wpa_supplicant.conf | awk -F'ssid=' '{ print $2 }' ORS=',' | sed 's/\"/''/g' | sed 's/,$//') +wpassid=$(awk '/ssid="/{ print $0 }' /etc/wpa_supplicant/wpa_supplicant.conf | awk -F'ssid=' '{ print $2 }' ORS=',' | sed 's/\"/''/g' | sed 's/,$//' | sed 's/\n//g' | sed 's/\r//g') IFS="," ssids=($wpassid) IFS=$IFSdef #reset back to defaults