summaryrefslogtreecommitdiffstats
path: root/external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean')
-rw-r--r--external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean14
1 files changed, 14 insertions, 0 deletions
diff --git a/external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean b/external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean
new file mode 100644
index 00000000..89c7e905
--- /dev/null
+++ b/external/meta-updater/recipes-connectivity/networkd-dhcp-conf/files/resolvconf-clean
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+if [ ! -L /etc/resolv.conf ]; then
+ exit 0
+fi
+
+# 'readlink -f' will fail if the symlink doesn't resolve to an existing path
+if readlink /etc/resolv.conf | grep -q connman; then
+ echo "Replacing resolv.conf symlink: $(readlink /etc/resolv.conf) to /etc/resolv-conf.systemd"
+ rm /etc/resolv.conf
+ ln -s /etc/resolv-conf.systemd /etc/resolv.conf
+fi