Score:0

Connecting to wifi wlan0 via command line

ru flag

I am writing a script where I would like to connect to the wifi from the script. The below command fails for me:

printf '%s\n' "$WIFIPASSPHRASE" | iwctl station wlan0 connect $WIFINETWORK

When I execute the script I get the below in my terminal output:

Type the network passphrase for _MYWIFI_ psk.

Passphrase: _my passphrase will be printed_

Operation aborted

Any idea how to fix this or a better way of achieving this?

David avatar
cn flag
The version of Ubuntu you are using is necessary.
Score:0
ru flag

This worked for me thank you. I was not aware of the --passphrase option.

iwctl --passphrase $WIFIPASSPHRASE station device connect $WIFINETWORK

May be piping the passphrase is not allowed.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.