Disable Wifi when you are connected by cable.

Wifi detects
Published by Daniel Ugarte 21 Feb 2019
When we use Wifi in a laptop and you connect to your Corporate Network, you don’t want your users to be connected to an unsecure wifi and at the same time in your Corporate Network. So, we can create a new profile where we use a script to detect the LAN network connection and automatically  disable wifi adapter. After you disconnect from the LAN network, wifi adapter is activated again.

This Script is for the Igel version 10. Wifi detects

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

Comments (4)

  1. Daniel, Thanks for this script. It’s exactly what I was looking for. Do you know if it’s still compatible with version 11? I would think it would be.

  2. Hi Daniel-

    I have been using your script in UMS and now since upgrading TC’s to 11.06.100 it is not working any longer, has anyone else seen this?

    Thanks in advance!

    • Yes, I know . In this version there is a new feature that I think it should replace the script. Take a look and try it.

      ### WiFi

      * Added new feature WiFi automatic switch on/off.
      The following registry key have been added:

      |Parameter |`Enable Wi-Fi automatic switch` |
      |Registry |`network.applet.wireless.enable_wifi_auto_switch` |
      |Type |bool |
      |Value |enabled / **disabled** (default) |

Comment here