systemd-resolved test
This commit is contained in:
parent
57db78c147
commit
69b5458185
|
@ -18,13 +18,6 @@ set -e
|
||||||
exit 1;
|
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
|
cat << EOF > /etc/systemd/network/dhcp.network
|
||||||
[Match]
|
[Match]
|
||||||
Name=*
|
Name=*
|
||||||
|
@ -46,6 +39,17 @@ EOF
|
||||||
systemctl disable networking
|
systemctl disable networking
|
||||||
systemctl enable systemd-networkd
|
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.
|
# Final warning.
|
||||||
printf 'Rebooting in 30 seconds, hit ctrl+c to cancel.\n'
|
printf 'Rebooting in 30 seconds, hit ctrl+c to cancel.\n'
|
||||||
sleep 30;
|
sleep 30;
|
||||||
|
|
Loading…
Reference in New Issue