From c7163547db2056b7de8ed8e4ebc49053975a7c08 Mon Sep 17 00:00:00 2001 From: pvincent Date: Mon, 29 Jul 2024 16:50:59 +0400 Subject: [PATCH] miaou-resolver attr read-only resolv.conf --- templates/network-manager/50-miaou-resolver | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/network-manager/50-miaou-resolver b/templates/network-manager/50-miaou-resolver index c38d0cd..a137dcd 100755 --- a/templates/network-manager/50-miaou-resolver +++ b/templates/network-manager/50-miaou-resolver @@ -2,6 +2,8 @@ if [[ "$2" == "up" ]]; then + chattr -i /etc/resolv.conf + ACTIVE_CONNECTION=$(nmcli -g NAME connection show --active | head -n1) ACTIVE_DEVICE=$(nmcli -g DEVICE connection show --active | head -n1) BRIDGE=$(ip addr show lxdbr0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1) @@ -19,6 +21,9 @@ if [[ "$2" == "up" ]]; then else logger -t NetworkManager:Dispatcher -p info "on $ACTIVE_DEVICE:$ACTIVE_CONNECTION nameservers look fine" fi + + chattr +i /etc/resolv.conf + else if [[ "$2" == "connectivity-change" ]]; then ACTIVE_DEVICE=$(nmcli -g DEVICE connection show --active | head -n1)