Page 1 of 1

nmcli command does not work in rc.local

Posted: 03 Sep 2021, 08:03
by Kulle
I wrote the following command to the rc.local file:

Code: Select all

nmcli dev wifi connect xyz password "abc"
where xyz is the SSID and abc is the password.
However, the command is not executed.
Is it ignored?

But if I change to the /etc/rc.d/ directory and run the rc.local file, the nmcli command works as expected.

Does anyone have an explanation?
What can I do?
Thanks

nmcli command does not work in rc.local

Posted: 03 Sep 2021, 12:35
by Kulle
In the meantime, I had an intuitive idea of my own:
I put the command sleep 3 in front of it.
Now it's working.

nmcli command does not work in rc.local

Posted: 03 Sep 2021, 15:51
by Ed_P
Kulle wrote:
03 Sep 2021, 12:35
sleep 3 in front of it.
:o An interesting approach.

nmcli command does not work in rc.local

Posted: 03 Sep 2021, 18:51
by Blaze
sleep 5 && your-command-is-here