Debian: Turn of wifi when on a wired connection

Create this file (be sure to set chmod +x on it) /etc/NetworkManager/dispatcher.d/99-wlan-disable
Here is what should be in the file:
#!/bin/bash
wired_interfaces="en.*|eth.*"
if [[ "$1" =~ $wired_interfaces ]]; then
case "$2" in
up)
nmcli radio wifi off
;;
down)
nmcli radio wifi on
;;
esac
fi

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.