Skip to content

Fix hard coded default wi-fi interface #176

@AHinMaine

Description

@AHinMaine

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions