blob: baffbc439b9f982d7a1fe4dbb4ed6b209a371fb5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/usr/bin/env sh
export LANG=C
interface="$1"
action="$2"
connectivity="$(nmcli networking connectivity)"
interface_type="$(nmcli -g GENERAL.TYPE device show "$interface")"
interface_state="$(nmcli -g GENERAL.STATE device show "$interface" | grep -o '^[0-9]\+')"
if [ "$action" = "down" ] && [ "$connectivity" = "none" ]; then
nmcli radio wifi on
exit
fi
if [ "$action" = "up" ] && [ "$interface_type" == "ethernet" ] && [ "$interface_state" = "100" ]; then
nmcli radio wifi off
exit
fi
|