Created
November 20, 2014 12:59
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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