blob: 79ac666e5a71de0991895d850c054fbd83953e07 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/sh
# https://wiki.archlinux.org/title/NetworkManager#Use_dispatcher_to_automatically_toggle_wireless_depending_on_LAN_cable_being_plugged_in
if [ "$1" = "enp2s0" ]; then
case "$2" in
up)
nmcli radio wifi off
;;
down)
nmcli radio wifi on
;;
esac
elif [ "$(nmcli -g GENERAL.STATE device show enp2s0)" = "20 (unavailable)" ]; then
nmcli radio wifi on
fi
|