I would like to write a script (.sh or similar) that automatically connects to a wifi network when I know the name and password of the network. Can anyone give me an example of how to do this? I am having trouble getting wpa supplicant to work.
I would like to write a script (.sh or similar) that automatically connects to a wifi network when I know the name and password of the network. Can anyone give me an example of how to do this? I am having trouble getting wpa supplicant to work.
You can create a script to write AP config to
/etc/wpa_supplicant.conf
and starting upwpa_supplicant
with the created configuration file manually. Please refer to the following example:Connect with
connect_wpa2_ap <ssid> <password>
.