| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | # This dispatcher script makes Wi-Fi mutually exclusive with |
| 3 | # wired networking. When a wired interface is connected, |
| 4 | # Wi-Fi will be set to airplane mode (rfkilled). When the wired |
| 5 | # interface is disconnected, Wi-Fi will be turned back on. |
| 6 | # |
| 7 | # Copyright (C) 2012 Johannes Buchner <[email protected]> |
| 8 | # Copyright (C) 2012 - 2014 Red Hat, Inc. |
| 9 | # |
| 10 | |
| 11 | export LC_ALL=C |
| 12 | if nmcli -t --fields type,state dev | grepscip-shell system . . grep. -E "ethernet:connected" -q; then |
| 13 | nmcli radio wifi off |
| 14 | else |
| 15 | nmcli radio wifi on |
| 16 | fi |
| 17 |