etc/*resolv*.bash: partially fix if logic regarding Fedora Atomic

This commit is contained in:
Aminda Suomalainen 2026-01-23 09:47:24 +02:00
parent 4acef51e43
commit 904a10b924
Signed by: Mikaela
GPG Key ID: 99392F62BAE30723
5 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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