iwd-wifi.bash: simple script for scanning and how to connect to network

This commit is contained in:
Aminda Suomalainen 2023-01-21 13:01:30 +02:00
parent 09c8440738
commit 3faa905345
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q
1 changed files with 19 additions and 0 deletions

19
bash/iwd-wifi.bash Executable file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env bash
# A simple script to list networks iwd detects and give instruction for
# connecting to it. Heavily inspired by `man iwctl`
# So the terminal is empty for the table
clear
# `iwctl device list` gives the WiFi adapters
WIFIDEVICE=wlan0
# Scan and list results
iwctl station $WIFIDEVICE scan
iwctl station $WIFIDEVICE get-networks
# Print the command to connect. Replace $KEY and $SSID with the actual ones
echo "% sudo iwctl --passphrase=\$KEY station $WIFIDEVICE connect \$SSID"
# For permanent connections https://gitea.blesmrt.net/mikaela/shell-things/src/branch/master/var/lib/iwd