From 32c5da4422cf7b48ff4e3d93939bb4fd37261a49 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Wed, 24 Apr 2024 12:08:05 +0300 Subject: [PATCH] etc/resolv.conf-generate.bash: also be verbose with chattr & chmod --- etc/resolv.conf-generate.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/resolv.conf-generate.bash b/etc/resolv.conf-generate.bash index 0926ec02..0a82fb24 100755 --- a/etc/resolv.conf-generate.bash +++ b/etc/resolv.conf-generate.bash @@ -9,8 +9,8 @@ fi # In case I am behind the /etc/resolv.conf, it's immutable and read-only, # which won't allow it to be rewritten. -chattr -i /etc/resolv.conf -chmod +w /etc/resolv.conf +chattr -V -i /etc/resolv.conf +chmod -v +w /etc/resolv.conf # Or it's a symlink to e.g. /run/systemd/resolve/stub-resolv.conf rm -v /etc/resolv.conf @@ -20,9 +20,9 @@ rm -v /etc/resolv.conf printf 'nameserver ::1\nnameserver 127.0.0.1\nnameserver 127.0.0.53\noptions edns0 trust-ad timeout:1 attempts:5\nsearch .\n' | tee -p /etc/resolv.conf # Remove all other permissions than everyone reading resolv.conf -chmod a=r /etc/resolv.conf +chmod -v a=r /etc/resolv.conf # Make resolv.conf immutable again so it's pretty sure nothing else edits it. -chattr +i /etc/resolv.conf +chattr -V +i /etc/resolv.conf # Let's just see it's ok ls -l /etc/resolv.conf