On Fri, Sep 06, 2019 at 11:01:35PM +0200, Klemens Nanni wrote:
> Rebased diff that I just tested again on a X230 with athn(4) where I
> installed over an ESSID of the form "Wifi foo" just fine;  empty ESSIDs
> showed up as "" in the list, all others still look normal and could be
> chosen just fine.
> 
> The resulting hostname.athn0 contained
> 
>       nwid 'Wifi foo'
>       dhcp
> 
> I'd like to finally commit this so occasional installations over said
> wifi will just work.
> 
> OK?
> 

Yes please, thanks.

> 
> Index: install.sub
> ===================================================================
> RCS file: /cvs/src/distrib/miniroot/install.sub,v
> retrieving revision 1.1140
> diff -u -p -r1.1140 install.sub
> --- install.sub       21 Aug 2019 17:39:30 -0000      1.1140
> +++ install.sub       6 Sep 2019 20:19:51 -0000
> @@ -1171,10 +1171,9 @@ v6_config() {
>  
>  # Perform an 802.11 network scan on interface $1 and cache the result a file.
>  ieee80211_scan() {
> -     # N.B. Skipping quoted nwid's for now.
>       [[ -f $WLANLIST ]] ||
>               ifconfig $1 scan |
> -             sed -n 's/^             nwid \([^"]\)/\1/p' >$WLANLIST
> +                     sed -n 's/^[[:space:]]*nwid \(.*\) chan [0-9]* bssid 
> \([[:xdigit:]:]*\).*/\1 (\2)/p' >$WLANLIST
>       cat $WLANLIST
>  }
>  
> @@ -1194,12 +1193,12 @@ ieee80211_config() {
>               ask_until "Access point? (ESSID, 'any', list# or '?')" "any"
>               case "$resp" in
>               +([0-9]))
> -                     _nwid=$(ieee80211_scan $_if | sed -n "${resp}s/ .*//p")
> +                     _nwid=$(ieee80211_scan $_if |
> +                         sed -n ${resp}'{s/ ([[:xdigit:]:]*)$//p;q;}')
>                       [[ -z $_nwid ]] && echo "There is no line $resp."
> +                     [[ $_nwid = \"*\" ]] && _nwid=${_nwid#\"} 
> _nwid=${_nwid%\"}
>                       ;;
> -             \?)     ieee80211_scan $_if |
> -                             sed -n 's/^\([^ ]*\) chan .* bssid \([^ ]*\) 
> .*$/       \1 (\2)/p' |
> -                             cat -n | more -c
> +             \?)     ieee80211_scan $_if | cat -n | more -c
>                       ;;
>               *)      _nwid=$resp
>                       ;;
> 

Reply via email to