2012-09-20 10:19:11 -05:00
|
|
|
#!/bin/bash
|
2018-11-21 11:32:38 +01:00
|
|
|
# This dispatcher script makes Wi-Fi mutually exclusive with
|
2012-09-20 10:19:11 -05:00
|
|
|
# wired networking. When a wired interface is connected,
|
2018-11-21 11:32:38 +01:00
|
|
|
# Wi-Fi will be set to airplane mode (rfkilled). When the wired
|
|
|
|
|
# interface is disconnected, Wi-Fi will be turned back on.
|
2014-04-25 09:54:05 -05:00
|
|
|
#
|
2019-10-01 09:20:35 +02:00
|
|
|
# Copyright (C) 2012 Johannes Buchner <buchner.johannes@gmx.at>
|
|
|
|
|
# Copyright (C) 2012 - 2014 Red Hat, Inc.
|
2014-04-25 09:54:05 -05:00
|
|
|
#
|
2012-09-20 10:19:11 -05:00
|
|
|
|
2014-04-25 09:54:05 -05:00
|
|
|
export LC_ALL=C
|
|
|
|
|
if nmcli -t --fields type,state dev | grep -E "ethernet:connected" -q; then
|
|
|
|
|
nmcli radio wifi off
|
|
|
|
|
else
|
|
|
|
|
nmcli radio wifi on
|
2012-09-20 10:19:11 -05:00
|
|
|
fi
|
|
|
|
|
|