From 904a10b924cf7982365eaa19e2a9d1f2b236a3c6 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Fri, 23 Jan 2026 09:47:24 +0200 Subject: [PATCH] etc/*resolv*.bash: partially fix if logic regarding Fedora Atomic --- etc/NetworkManager-resolv.conf-restore.bash | 2 +- etc/resolv.conf-generate.bash | 4 ++-- etc/systemd-resolv.conf-generate.bash | 4 ++-- etc/systemd-resolv.conf-restore.bash | 2 +- etc/traditional-resolv.conf-generate.bash | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/etc/NetworkManager-resolv.conf-restore.bash b/etc/NetworkManager-resolv.conf-restore.bash index 4405586e..ca7ef078 100755 --- a/etc/NetworkManager-resolv.conf-restore.bash +++ b/etc/NetworkManager-resolv.conf-restore.bash @@ -5,7 +5,7 @@ set -x # well. I think it's even less likely I use this than the systemd-resolved # one, but anyway -if [[ ! -d /sysroot/ostree ]]; then +if [[ -d /sysroot/ostree ]]; then echo "Let's not mess up with Fedora Atomic. Try \$RES_OPTIONS instead? In profile.d?" exit 1 fi diff --git a/etc/resolv.conf-generate.bash b/etc/resolv.conf-generate.bash index b9d1f9d7..b048bc39 100755 --- a/etc/resolv.conf-generate.bash +++ b/etc/resolv.conf-generate.bash @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -x -if [[ ! -d /sysroot/ostree ]]; then +if [[ -d /sysroot/ostree ]]; then echo "Let's not mess up with Fedora Atomic. Try \$RES_OPTIONS instead? In profile.d?" exit 1 fi @@ -25,7 +25,7 @@ rm -v /etc/resolv.conf printf 'nameserver ::1\nnameserver 127.0.0.1\nnameserver 127.0.0.53\nsearch .\noptions timeout:1 attempts:5 rotate edns0 trust-ad\n' | tee -p /etc/resolv.conf # Are we on Fedora Atomic? -if [[ ! -d /sysroot/ostree ]]; then +if [[ -d /sysroot/ostree ]]; then # Remove all other permissions than everyone reading resolv.conf chmod -v a=r /etc/resolv.conf # Make resolv.conf immutable again so it's pretty sure nothing else edits it diff --git a/etc/systemd-resolv.conf-generate.bash b/etc/systemd-resolv.conf-generate.bash index 0e655bfe..c9912f2c 100755 --- a/etc/systemd-resolv.conf-generate.bash +++ b/etc/systemd-resolv.conf-generate.bash @@ -5,7 +5,7 @@ set -x # systemd-resolved as a DNS server. And then it also took parts of the # restore script. -if [[ ! -d /sysroot/ostree ]]; then +if [[ -d /sysroot/ostree ]]; then echo "Let's not mess up with Fedora Atomic. Try \$RES_OPTIONS instead? In profile.d?" exit 1 fi @@ -37,7 +37,7 @@ rm -v /etc/resolv.conf printf 'nameserver 127.0.0.53\nnameserver 127.0.0.53\nnameserver 127.0.0.53\nsearch .\noptions timeout:1 attempts:5 rotate edns0 trust-ad\n' | tee -p /etc/resolv.conf # Are we on Fedora Atomic? -if [[ ! -d /sysroot/ostree ]]; then +if [[ -d /sysroot/ostree ]]; then # Remove all other permissions than everyone reading resolv.conf chmod -v a=r /etc/resolv.conf # Make resolv.conf immutable again so it's pretty sure nothing else edits it diff --git a/etc/systemd-resolv.conf-restore.bash b/etc/systemd-resolv.conf-restore.bash index 05d06fc4..79b064be 100755 --- a/etc/systemd-resolv.conf-restore.bash +++ b/etc/systemd-resolv.conf-restore.bash @@ -4,7 +4,7 @@ set -x # I just had a feeling I should also have a quick script to quickly restore # systemd-resolved handling of the file. -if [[ ! -d /sysroot/ostree ]]; then +if [[ -d /sysroot/ostree ]]; then echo "Let's not mess up with Fedora Atomic. Try \$RES_OPTIONS instead? In profile.d?" exit 1 fi diff --git a/etc/traditional-resolv.conf-generate.bash b/etc/traditional-resolv.conf-generate.bash index 3a21dc96..2c015b49 100755 --- a/etc/traditional-resolv.conf-generate.bash +++ b/etc/traditional-resolv.conf-generate.bash @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -x -if [[ ! -d /sysroot/ostree ]]; then +if [[ -d /sysroot/ostree ]]; then echo "Let's not mess up with Fedora Atomic. Try \$RES_OPTIONS instead? In profile.d?" exit 1 fi