pondělí 8. srpna 2016

Ubuntu (Mate 16.04) - disable WiFi when ethernet cable is plugged in

Use following script to create rule, which disables wifi if the ethernet cable connection is up. The solution is based on this stackoverflow article.
sudo cat > /etc/NetworkManager/dispatcher.d//99-disable-wifi-if-not-needed <<EOT
#!/bin/bash

if [ "$1" = "enp0s25" ]; then
    case "$2" in
        up)
            nmcli radio wifi off
            ;;
        down)
            nmcli radio wifi on
            ;;
    esac
fi

Replace the enp0s25 with the correct "cable" interface if needed.

Žádné komentáře: