behzad.nouri
behzad.nouri

Reputation: 77951

If lan is connected?

I want to write a script and put it in /etc/rc.local so that

if lan is connected then

rfkill block all

else

nmcli con up id 'Network id' --nowait

How should I write the if part and how should I check for "lan is connected" ?

Upvotes: 0

Views: 517

Answers (1)

krtek
krtek

Reputation: 26597

You can check : How to detect the physical connected state of a network cable/connector?

I think at least one of the answer should work for you !

Upvotes: 3

Related Questions