Commit 452f8854 authored by David Johnson's avatar David Johnson
Browse files

Handle multiple nameservers in manual resolv.conf systemd-networkd path.

Also fixes an unrelated minor bug.
parent bceb5ff5
......@@ -145,13 +145,15 @@ fi
if [ -L /etc/resolv.conf \
-a ! -f `readlink -f /etc/resolv.conf` \
-f /run/systemd/resolve/resolv.conf ]; then
-a -f /run/systemd/resolve/resolv.conf ]; then
echo "`date`: fixing /etc/resolv.conf to point to /run/systemd/resolve/resolv.conf" >>$LOGFILE 2>&1
ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
elif [ ! -L /etc/resolv.conf ]; then
echo "`date`: updating static /etc/resolv.conf; should be symlink!" >>$LOGFILE 2>&1
rm -f /etc/resolv.conf
echo nameserver $DNS > /etc/resolv.conf
for ns in $DNS ; do
echo nameserver $ns >> /etc/resolv.conf
echo search $DOMAINNAME >> /etc/resolv.conf
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment