aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/contrib/dns-hatchet
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/dns-hatchet')
-rw-r--r--contrib/dns-hatchet/hatchet.bash2
1 files changed, 2 insertions, 0 deletions
diff --git a/contrib/dns-hatchet/hatchet.bash b/contrib/dns-hatchet/hatchet.bash
index 793684c..5857cc1 100644
--- a/contrib/dns-hatchet/hatchet.bash
+++ b/contrib/dns-hatchet/hatchet.bash
@@ -17,9 +17,11 @@ set_dns() {
printf 'nameserver %s\n' "${DNS[@]}"
} | unshare -m --propagation shared bash -c "$(cat <<-_EOF
set -e
+ context="\$(stat -c %C /etc/resolv.conf 2>/dev/null)" || unset context
mount --make-private /dev/shm
mount -t tmpfs none /dev/shm
cat > /dev/shm/resolv.conf
+ [[ -z \$context || \$context == "?" ]] || chcon "\$context" /dev/shm/resolv.conf 2>/dev/null || true
mount -o remount,ro /dev/shm
mount -o bind,ro /dev/shm/resolv.conf /etc/resolv.conf
_EOF