summaryrefslogtreecommitdiff
path: root/etc/NetworkManager
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2023-12-22 05:39:58 +0000
committerXiao Pan <gky44px1999@gmail.com>2023-12-22 05:39:58 +0000
commit9d811c3d9c1f4e7ad90c9b1e2bc0d85d1c7da225 (patch)
treeee52e4a14a19b15e0eeca11fa6a30d2788b6b482 /etc/NetworkManager
parent5480be3cd5e9fd4c504351ea125f5128799d6c10 (diff)
nginx enable ipv6. Switch from systemd-networkd to networkmanager because somehow I could not ping studio global pubic ipv6 (stateless address auto-configuration? (SLAAC)?), but I can ping link-local address which makes the issue very weird
Diffstat (limited to 'etc/NetworkManager')
-rwxr-xr-xetc/NetworkManager/dispatcher.d/70-wifi-wired-exclusive16
1 files changed, 16 insertions, 0 deletions
diff --git a/etc/NetworkManager/dispatcher.d/70-wifi-wired-exclusive b/etc/NetworkManager/dispatcher.d/70-wifi-wired-exclusive
new file mode 100755
index 00000000..79ac666e
--- /dev/null
+++ b/etc/NetworkManager/dispatcher.d/70-wifi-wired-exclusive
@@ -0,0 +1,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