Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wifi-menu: Multi-interface support and man page. #178

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Makefile for netctl documentation

MANPAGES = netctl.1 netctl-auto.1 netctl.profile.5 netctl.special.7
MANPAGES = netctl.1 netctl-auto.1 netctl.profile.5 netctl.special.7 wifi-menu.8

.PHONY: manpages install $(MANPAGES:=-install) clean

Expand Down
118 changes: 118 additions & 0 deletions docs/wifi-menu.8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
WIFI-MENU(8)
============

NAME
----
wifi-menu - Interactively connect to a wireless network


SYNOPSIS
--------
*wifi-menu* [-o | --obscure] [+INTERFACE+]

*wifi-menu* [-h | --help]


DESCRIPTION
-----------
tetrakist marked this conversation as resolved.
Show resolved Hide resolved
*wifi-menu* allows a user to interactively connect to a wireless network
over INTERFACE using a auto-generated netctl profile. If only one
tetrakist marked this conversation as resolved.
Show resolved Hide resolved
wireless interface is available, INTERFACE can be omitted. Additionally,
if INTERFACE is omitted and more than one wireless interface is found,
the user is prompted to select which interface should be used.
tetrakist marked this conversation as resolved.
Show resolved Hide resolved

Once a valid interface is specified, wifi-menu uses *wpa_supplicant*(8)
to scan for available wireless networks, and presents the results to the
user in a menu. Entries are marked with one of the following flags to
indicate their status:
tetrakist marked this conversation as resolved.
Show resolved Hide resolved

***::
An active connect is present.

*:*::
A hand-made profile is present.

*.*::
An automatically-generated profile is present.
tetrakist marked this conversation as resolved.
Show resolved Hide resolved

If a network is selected that already has a profile, the profile is
immediately started with no further interaction. However, if the selected
network lacks a profile, the user is given the option of accepting or
changing the provided profile name. Next, if the selected network is
encrypted, the user is prompted to enter a passphrase or pre-shared key,
as appropriate. Once this is done, a *netctl*(1) profile is created and
then started. If the connection is successful, the program exits; if
unsuccessful, the user is asked whether the profile should still be saved.
tetrakist marked this conversation as resolved.
Show resolved Hide resolved

OPTIONS
-------

*-h, --help*::
Show help
tetrakist marked this conversation as resolved.
Show resolved Hide resolved

*-o, --obscure*::
Show asterisks for the characters of the password and store the password
as a hexadecimal string.
tetrakist marked this conversation as resolved.
Show resolved Hide resolved

+INTERFACE+::
Specifies the wireless network interface to use when connecting to a
wireless network.
tetrakist marked this conversation as resolved.
Show resolved Hide resolved


EXIT STATUS
-----------

*0*::
The interface connected to the wireless network successfully.

*1*::
The connection attempt was cancelled.

*2*::
The connection attempt failed.

*3*::
No wireless networks were found.

*4*::
Invalid passphrase length (WEP keys must be between 8 and 63 characters
in length).

*7*::
An unexpected error code was received.

*255*::
The connection attempt was aborted (or an error occurred).
tetrakist marked this conversation as resolved.
Show resolved Hide resolved


NOTES
-----
The program may display a black screen for up to a minute when starting a
connection.
tetrakist marked this conversation as resolved.
Show resolved Hide resolved

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how best to word a statement about control by netctl-auto and switching profiles, so I will leave that for you to do as you see fit.

Maybe here? I'd appreciate your comments. Rather than me just adding a commit on top of yours, I think it is nice to make this part of your commit.

Suggested change
Starting a connection on an interface that is controlled by *netctl-auto* will
cause *wifi-menu* to switch to the selected network. The interface will continue
to be controlled by *netctl-auto*.


BUGS
----
This program is not capable of setting up and establishing connections that
require configurations more complex than the specification of a passphrase.
In such situations, one should manually configure and establish the
connection using a network manager such as *netctl*(1), or use lower-level
utilities such as *wpa_supplicant*(8) directly, along with *ip*(8) or
*dhcpcd*(8) for configuring IP connectivity.
tetrakist marked this conversation as resolved.
Show resolved Hide resolved


ENVIRONMENT
-----------
+$NETCTL_DEBUG+::
If set to "yes", debugging output is generated.
tetrakist marked this conversation as resolved.
Show resolved Hide resolved


FILES
-----
+/etc/netctl+::
Directory where created netctl profiles are stored.
tetrakist marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one got lost too. Here, 'generated' is more specific than 'created' and 'netctl' is implied.

Suggested change
Directory where created netctl profiles are stored.
Directory where generated profiles are stored.



SEE ALSO
--------
*netctl*(1), *wpa_supplicant*(8), *iwd*(8)
tetrakist marked this conversation as resolved.
Show resolved Hide resolved
tetrakist marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 9 additions & 4 deletions src/wifi-menu
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,18 @@ cd / # We do not want to spawn anything that can block unmounting

INTERFACE=$1
if [[ -z "$INTERFACE" ]]; then
INTERFACE=(/sys/class/net/*/wireless/)
if [[ ${#INTERFACE[@]} -ne 1 || ! -d "$INTERFACE" ]]; then
report_error "Invalid interface specification"
INTERFACES=(/sys/class/net/*/wireless/)
if [[ ${#INTERFACES[@]} -gt 1 ]]; then
report_debug "Multiple wireless interfaces found: '${INTERFACES[@]}'"
INTERFACE_LIST=$(for IFACE in ${INTERFACES[@]}; do echo ${IFACE:15:-10}; done)
INTERFACE=$(dialog --no-items --menu "Select wireless interface you wish to use:" 13 50 12 $INTERFACE_LIST --stdout)
tetrakist marked this conversation as resolved.
Show resolved Hide resolved
elif [[ -d "$INTERFACES" ]]; then
INTERFACE=${INTERFACES:15:-10}
else
report_error "No wireless interfaces found"
usage
exit 255
fi
INTERFACE=${INTERFACE:15:-10}
tetrakist marked this conversation as resolved.
Show resolved Hide resolved
report_debug "Using interface '$INTERFACE'"
elif ! is_interface "$INTERFACE"; then
exit_error "No such interface: $INTERFACE"
Expand Down