开发者

If lan is connected?

开发者 https://www.devze.com 2023-02-13 12:54 出处:网络
I want to write a开发者_如何学运维 script and put it in /etc/rc.local so that if lan is connected then

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


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 !

0

精彩评论

暂无评论...
验证码 换一张
取 消