From 5d955b86afdb5d849967e9151b9261b43ba68e11 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Thu, 1 Jun 2017 20:09:39 +0200 Subject: [PATCH] init-ifupdown: fix script when '/etc/resolv.conf' is a file The readlink command on a real file was expanding to nothing and then the '/etc/resolv.conf' file was not being updated with the nameservers. With this change we only run the 'readlink' link command after checking that the file is actually a symbolic link. Signed-off-by: Javier Viguera --- .../recipes-core/init-ifupdown/init-ifupdown-1.0/resolv | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/resolv b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/resolv index ecc0b4070..b11f148c9 100644 --- a/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/resolv +++ b/meta-digi-dey/recipes-core/init-ifupdown/init-ifupdown-1.0/resolv @@ -18,7 +18,10 @@ # Only for static method [ "${METHOD}" != "static" ] && exit 0 -RESOLVCONF="$(readlink /etc/resolv.conf)" +RESOLVCONF="/etc/resolv.conf" + +# For symlinks reset to the destination file +[ -h "${RESOLVCONF}" ] && RESOLVCONF="$(readlink ${RESOLVCONF})" NAMESERVERS="" for NS in ${IF_DNS_NAMESERVER} ${IF_DNS_NAMESERVERS}; do