I am writing a shell script (bash) to do some system configuration and one of the steps is entering a wifi SSID and password. I’m on Ubuntu 22.04.
I then connect by creating an appropriate netplan file and running netplan apply
.
At some point after this (given enough time to connect to the network) I want to notify the user of the connection status.
I’d like to be able to specifically tell them if the password was incorrect, but I can’t figure out a way to determine this. All I know how to do is check for general connectivity by pinging one of my servers, but I want to be able to distinguish between an incorrect password vs. lack of connectivity.
Is there a way, after running netplan apply
, to determine if the network connection could not be established due to an incorrect WiFi password?