diff options
| author | Loek Le Blansch <loek@pipeframe.xyz> | 2026-08-02 15:40:01 +0200 |
|---|---|---|
| committer | Loek Le Blansch <loek@pipeframe.xyz> | 2026-08-02 15:40:01 +0200 |
| commit | 84dd5d0d25b6ff22497c27407099a4d4b1293587 (patch) | |
| tree | b047275461700addf96b71833d6947afc4e0d46b /root/etc/NetworkManager | |
| parent | db8249bd20d3afe03fa994ba2a486d5f4683fa3c (diff) | |
move root files
Diffstat (limited to 'root/etc/NetworkManager')
| -rw-r--r-- | root/etc/NetworkManager/dispatcher.d/executable_70-auto-wifi.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/root/etc/NetworkManager/dispatcher.d/executable_70-auto-wifi.sh b/root/etc/NetworkManager/dispatcher.d/executable_70-auto-wifi.sh new file mode 100644 index 0000000..4680626 --- /dev/null +++ b/root/etc/NetworkManager/dispatcher.d/executable_70-auto-wifi.sh @@ -0,0 +1,21 @@ +#!/bin/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 + |