From 681550f663f1c0b9235d02cbca3fc741d2dd7951 Mon Sep 17 00:00:00 2001 From: "m@tilson" Date: Sat, 2 Jul 2022 23:04:36 +0300 Subject: [PATCH] To be able to run OpenVPN client in Docker container The file `/etc/resolv.conf` is not a regular one in Docker container, it is bind-mounts within container. It cause `cp: can't create '/etc/resolv.conf': File exists` error and as a result `resolv.conf.ovpnsave` is not copied back as it is intended. But rewriting the file instead of moving or renaming is possible. --- contrib/pull-resolv-conf/client.down | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/pull-resolv-conf/client.down b/contrib/pull-resolv-conf/client.down index 0cbb476582f..42ca2d471cb 100644 --- a/contrib/pull-resolv-conf/client.down +++ b/contrib/pull-resolv-conf/client.down @@ -44,7 +44,7 @@ if type resolvconf >/dev/null 2>&1; then resolvconf -d "${dev}" -f elif [ -e /etc/resolv.conf.ovpnsave ] ; then # cp + rm rather than mv in case it's a symlink - cp /etc/resolv.conf.ovpnsave /etc/resolv.conf + cat /etc/resolv.conf.ovpnsave > /etc/resolv.conf rm -f /etc/resolv.conf.ovpnsave fi