0

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" ?

behzad.nouri
  • 74,723
  • 18
  • 126
  • 124

1 Answers1

3

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 !

Community
  • 1
  • 1
krtek
  • 26,334
  • 5
  • 56
  • 84