Help with script to disable the wireless adapter if a physical network connection is present on IGEL OS


I am using a script to disable the wireless adapter if a physical network connection is present. It worked fine until recent firmware update. The behavior now is if I have no wired network connection the wireless radio still shuts off. I have the script at system-firmware customization-custom commands- base under initialization

Learn more, read the entire thread inside the IGEL Community o Slack

Script:

echo ‘#!/bin/bash’ >> /etc/NetworkManager/dispatcher.d/99-wlan

echo ‘if [ “$1” = “eth0” ]; then’ >> /etc/NetworkManager/dispatcher.d/99-wlan

echo ‘case “$2” in’ >> /etc/NetworkManager/dispatcher.d/99-wlan

echo ‘up)’ >> /etc/NetworkManager/dispatcher.d/99-wlan

echo ‘nmcli radio wifi off’ >> /etc/NetworkManager/dispatcher.d/99-wlan

echo ‘;;’ >> /etc/NetworkManager/dispatcher.d/99-wlan

echo ‘down)’ >> /etc/NetworkManager/dispatcher.d/99-wlan

echo ‘nmcli radio wifi on’ >> /etc/NetworkManager/dispatcher.d/99-wlan

echo ‘;;’ >> /etc/NetworkManager/dispatcher.d/99-wlan

echo ‘esac’ >> /etc/NetworkManager/dispatcher.d/99-wlan

echo ‘fi’ >> /etc/NetworkManager/dispatcher.d/99-wlan

chmod +x /etc/NetworkManager/dispatcher.d/99-wlan


Which firmware are we speaking about? And from which to which did it broke?


I have not seen the issue with 11.02.100 I first saw the issue with 11.02.130 and continue to see it with 11.2.150. I am working on testing a device with out the script to see if I get the same behavior.I will post my results.

Same behavior with out script. It is acting like the default is for the wireless adapter to be off. I can click on the wireless icon on the tool bar and enable wireless and it uses the wireless profile settings to connect.


Ok, strange. So you set a profile (I guess based on 11.02.***), where you activated the Wireless adapter „Activate wireless interface“ and Enable Wireless Manager? Right?

If yes, could you reset to factory defaults and retry?


I am having the same issue


Yes Sebastien

On my test device group I rolled back the firmware to 11.2.100 still did not work. I am going to update the firmware to the latest version and test. This is what I did to make the wireless radio turn on. I added the following custom command under system-firmware customization-custom commands-network under network initialization I added: nmcli radio wifi on

;;

esac

fi

EOF

chmod +x /etc/NetworkManager/dispatcher.d/99-wlan

So further testing and it does not work if the lan connection is not plugged in. If i connect the wired network then unplug it the wireless adapter will turn on. With out a wired network connection the wireless will not restart. So I think I need to figure out the proper location to place the script to turn on the wireless radio.


Well, dispatcher.d should be the right place I guess! Not in the office anymore, will try to debug next week!

Can you share your test env?

Device, Wifi Adapter, Network card type, name of both interfaces in Linux?


Yes I will attach a file when I get the info.

So I was able to prove that the Wireless radio Is not disabled on firmware 11.1.130. So something starting with 11.2 is causing the issue. As soon as I upgrade the firmware the radio disables.

I added a new profile call Activate wireless under network lan interface-wireless check activate Wireless interface. this fixed the issue for me. I still have the same setting checked for my original wireless profile with the script above and the SSID info.


Sorry to ask, that‘s what you already had checked above, or am I missing something?


I have it checked in the Wireless profile That contained my Wireless SSID and the above script. Adding a new profile that just has the wireless check bock marked active and nothing else. I also tried removing the script prior to adding the new profile and the radio still was disabled.

Continue reading and comment on the thread ‘Help with script to disable the wireless adapter if a physical network connection is present on IGEL OS’.  Not a member? Join Here!

Learn more, search the IGEL Knowledge Base



Ask a question or comment on the above message thread?

Join or log in to the IGEL Community to ask us anything and meet other IGEL customers, partners, and EUC enthusiasts.

Submit a question, or Join Today!


Popular Message Threads


Categories & Tags: