Guest User

Untitled

a guest
Sep 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #! /bin/sh
  2. # path should be /etc/NetworkManager/dispatcher.d/99-disable-wireless-when-wired
  3.  
  4. self=${0##*/}
  5. log() { logger -p user.info -t "${self}[$$]" "$*" ;}
  6.  
  7. iface=$1
  8. action=$2
  9.  
  10. case $iface in eth*|usb*|en*)
  11. case $action in
  12. up)
  13. log "disabling wifi"
  14. nmcli radio wifi off ;;
  15. down)
  16. log "enabling wifi"
  17. nmcli radio wifi on ;;
  18. esac
  19. esac
Add Comment
Please, Sign In to add comment