From 2e62745e7bf1dce5806a9433dbe8a8f4adc91e37 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Sat, 18 Jun 2022 15:18:17 +0200 Subject: [PATCH] unify wpa_supplicant --- distros/void/wpa_cli.md | 36 ------------------------------------ networking/wpa_supplicant.md | 36 ++++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 48 deletions(-) delete mode 100644 distros/void/wpa_cli.md diff --git a/distros/void/wpa_cli.md b/distros/void/wpa_cli.md deleted file mode 100644 index ab64ce6..0000000 --- a/distros/void/wpa_cli.md +++ /dev/null @@ -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"\" - diff --git a/networking/wpa_supplicant.md b/networking/wpa_supplicant.md index 1e265b6..df30221 100644 --- a/networking/wpa_supplicant.md +++ b/networking/wpa_supplicant.md @@ -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"\"