You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the default wifi interface is en0, however, it's not actually en0 on all devices, so commands like 'm wifi ls' simply returns the message "en0 is not a Wi-Fi interface."
As it sits, there's a few options:
Run something like networksetup -listallhardwareports | awk -F': ' '/Hardware Port: Wi-Fi/ { getline; print $2}' every single time. Ouch.
Tell people to populate the environment variable _W_DEVICE appropriately in their shell config. Meh.
During installation, run the previously mentioned networksetup command and then create a configuration script file in INSTALL_DIR/etc/m.conf (or somewhere better). So after installation that file would contain contain _W_DEVICE=en1 (or whatever networksetup actually found). Then have m source that config file at runtime.
I'd be happy to submit a PR based on consensus of what would be the preferred method. Thoughts?
Thanks!
The text was updated successfully, but these errors were encountered:
🤔 Ooh, configuration. We've not needed any thus far, so this is an interesting proposal.
Normally I'd be reluctant to add a config file for one setting, but I agree the other options are a little... lame. The other option is a runtime flag '-i interface', ala wpa_supplicant.
If you want to put a RFC/PR for a config proposal, it'd be good to see what that'd look like before we completely commit to it.
Here's a vote for a command-line based parser thing like the first option. It's what I used in a previous PR (#135) and if it helps, this might be a little less ugly:
Right now, the default wifi interface is en0, however, it's not actually en0 on all devices, so commands like 'm wifi ls' simply returns the message "en0 is not a Wi-Fi interface."
As it sits, there's a few options:
networksetup -listallhardwareports | awk -F': ' '/Hardware Port: Wi-Fi/ { getline; print $2}'
every single time. Ouch._W_DEVICE
appropriately in their shell config. Meh.networksetup
command and then create a configuration script file inINSTALL_DIR/etc/m.conf
(or somewhere better). So after installation that file would contain contain_W_DEVICE=en1
(or whatever networksetup actually found). Then have m source that config file at runtime.I'd be happy to submit a PR based on consensus of what would be the preferred method. Thoughts?
Thanks!
The text was updated successfully, but these errors were encountered: