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 all 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
89 changes: 89 additions & 0 deletions docs/wifi-menu.8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
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 an existing netctl profile, or an automatically
generated profile for basic configurations. If only one wireless
Comment on lines +19 to +20
Copy link
Owner

Choose a reason for hiding this comment

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

The fact that only basic configurations are supported for generating profiles is already stressed in the next paragraph. No need to state it twice.

Suggested change
over INTERFACE using an existing netctl profile, or an automatically
generated profile for basic configurations. If only one wireless
on INTERFACE using a netctl profile. In case no netctl profile is available, one can be generated.
If only one wireless

(pending reflow to the proper number of columns)

interface is available, INTERFACE can be omitted. If no interface is
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
interface is available, INTERFACE can be omitted. If no interface is
interface is available, INTERFACE can be omitted. If no interface is

(for consistency)

specified and more than one is detected, a choice of interfaces is
offered.

*wifi-menu* is only able to generate netctl profiles for simple network
configurations. Profiles for more complex configurations must be set up
manually, or through the use of other tools.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
manually, or through the use of other tools.
manually.

This man-page is about wifi-menu, so we assume the intent is to use netctl.


OPTIONS
-------

*-h, --help*::
Print a short help text and exit.

*-o, --obscure*::
Do not echo password, and store derived pre-shared key
in profile instead of plaintext password.
Comment on lines +36 to +37
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 fine with "do not echo password". The "Show asterisks..." bit is just cut-and-paste from the output of --help. ;)

Ah, thanks for this remark! That reminds me of why I chose this wording. The 'do not echo' wording applies more to what you see for instance when you type your password on a login terminal (i.e. nothing at all).
Let's revert to something that closely resembles your original idea.

Suggested change
Do not echo password, and store derived pre-shared key
in profile instead of plaintext password.
Show asterisks for the characters of the password and store the password
as a hexadecimal pre-shared key.


+INTERFACE+::
The wireless network interface to use for connecting.


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.
Comment on lines +71 to +72
Copy link
Owner

Choose a reason for hiding this comment

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

I believe this one got lost somewhere. If you disagree with my preference to make 'minute' refer less to a specific unit of time, I'd like to hear why.

Suggested change
The program may display a black screen for up to a minute when starting a
connection.
Establishing a connection may take a minute. While establishing a connection,
nothing is shown on screen.


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*.


ENVIRONMENT
-----------
+$NETCTL_DEBUG+::
If set to +"yes"+, debugging output is generated.


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), *netctl-auto*(1)
18 changes: 12 additions & 6 deletions src/wifi-menu
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ If only one wireless interface is available, INTERFACE can be omitted.

Arguments:
-h, --help Show this help
-o, --obscure Show asterisks for the characters of the password
and store the password as a hexadecimal string
-o, --obscure Do not echo password, and store derived pre-shared
key in profile instead of plaintext password.
Comment on lines +18 to +19
Copy link
Owner

Choose a reason for hiding this comment

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

Sorry about this ;-).

Suggested change
-o, --obscure Do not echo password, and store derived pre-shared
key in profile instead of plaintext password.
-o, --obscure Show asterisks for the characters of the password
and store the password as a hexadecimal string

END
}

Expand Down Expand Up @@ -242,13 +242,19 @@ 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
INTERFACES=$(for INTERFACE in ${INTERFACES[@]}; do
echo ${INTERFACE:15:-10}
done)
INTERFACE=$(dialog --no-items --menu "Select the interface you wish to use" 24 50 12 $INTERFACES --stdout)
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