Skip to content

Instantly share code, notes, and snippets.

@rkmax
Created November 20, 2014 12:59
Show Gist options
  • Save rkmax/63f7227ae2690e2c1312 to your computer and use it in GitHub Desktop.
Save rkmax/63f7227ae2690e2c1312 to your computer and use it in GitHub Desktop.
Deshabilita el wifi del equipo si se conecta el cable de red y lo vuelve a activar al desconectarse
#!/bin/bash
# copy this script to /etc/NetworkManager/dispatcher.d/99-disable-lan-on-wire.sh
# own by root and set permissions to 700
# eth0, eth1, etc.
LAN_IFACE="enp3s0"
if [[ "${1}" = "${LAN_IFACE}" ]]; then
case "${2}" in
up)
nmcli radio wifi off
;;
down)
nmcli radio wifi on
;;
esac
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment