systemd-resolved test

This commit is contained in:
mpmc 2023-05-23 00:22:51 +01:00
parent 57db78c147
commit 69b5458185
1 changed files with 11 additions and 7 deletions

View File

@ -18,13 +18,6 @@ set -e
exit 1;
)
apt install systemd-resolved
# Enable systemd-resolved & link stub-resolv.conf.
systemctl enable --now systemd-resolved
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
cat << EOF > /etc/systemd/network/dhcp.network
[Match]
Name=*
@ -46,6 +39,17 @@ EOF
systemctl disable networking
systemctl enable systemd-networkd
# Only enable systemd if it's installed.
(apt install systemd-resolved && \
# Enable systemd-resolved & link stub-resolv.conf.
systemctl enable --now systemd-resolved && \
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf) || \
# Note that systemd-resolved is not available.
printf 'systemd-resolved not available! OK, skipping it...\n';
# Final warning.
printf 'Rebooting in 30 seconds, hit ctrl+c to cancel.\n'
sleep 30;