unify wpa_supplicant

This commit is contained in:
Malin Freeborn 2022-06-18 15:18:17 +02:00
parent 56fdeeea3b
commit 2e62745e7b
Signed by: andonome
GPG Key ID: 52295D2377F4D70F
2 changed files with 24 additions and 48 deletions

View File

@ -1,36 +0,0 @@
---
title: "wifi"
tags: [ "Documentation", "void" ]
---
# wpa_supplicant
> scan
> scan_results
> add_network
> set_network 0 ssid "MYSSID"
> set_network 0 psk "passphrase"
OR > set_network 0 key_mgmt NONE
> enable_network 0
> save_config
might want to 'sudo sv restart dhcpcd'
## CLI
You can use all commands non-interactively, from the cli, e.g.:
> wpa_cli scan
> wpa_cli scan_results
But remember to escape the quotes, so adding a network would be:
> wpa_cli set_network 3 psk \""passphrase"\"

View File

@ -23,7 +23,7 @@ Next up, start wpa_supplicant:
The -B flag runs this as a background process. Remove this to see real-time output in order to solve problems. The -i flag denotes the physical device used for the wifi. The -c flag points to the configuration file for use.
# Automatic WiFi Connection
## Automatic WiFi Connection
> wpa_cli
@ -33,27 +33,39 @@ This has a number of commands to input. In order:
> scan_results
> add_Network
> add_network
This outputs a Network number, e.g. '3'. This is the new Network you'll work with.
This outputs a network number, e.g. '3'. This is the new network you'll work with.
> set_Network 3 ssid "Kosachok Cafe"
> set_network 3 ssid "Kosachok Cafe"
> set_Network 3 psk "Kosachok2019"
> set_network 3 psk "Kosachok2019"
OR
OR (for no password)
> set_Network 3 key_mgmt NONE
> set_network 3 key_mgmt NONE
> enable_Network 3
> enable_network 3
> save_config
...and possibly:
...and for the impatient:
> sudo sv restart dhcpcd
> sudo sv restart wpa_supplicant
or maybe:
## Scripts
> dhcpd wlp3s0
You can script like this:
> wpa_cli add_network
That returns an ID, so you can say:
> newNetwork="$(wpa_cli add_network)"
Then `$newNetwork` would equal that number, and you can add/ remove networks with scripts.
But remember to escape the quotes, so adding a network would be:
> wpa_cli set_network 3 psk \""passphrase"\"