Created
May 25, 2012 18:03
-
-
Save pboehm/2789537 to your computer and use it in GitHub Desktop.
Wifi enable/disable script that will be called from NetworkManager
This file contains hidden or 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 | |
# | |
# Script that disables your wifi if a wired connection turns on | |
# and it reenabkes wifi if the wired connection is going down. | |
# | |
# should be placed in /etc/NetworkManager/dispatcher.d/ and should | |
# be executable | |
if [[ -n `echo $1 | grep "em*"` ]]; then | |
case "$2" in | |
up) | |
nmcli nm wifi off | |
;; | |
down) | |
nmcli nm wifi on | |
;; | |
esac | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment