Skip to content

Instantly share code, notes, and snippets.

@pboehm
Created May 25, 2012 18:03
Show Gist options
  • Save pboehm/2789537 to your computer and use it in GitHub Desktop.
Save pboehm/2789537 to your computer and use it in GitHub Desktop.
Wifi enable/disable script that will be called from NetworkManager
#!/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