#!/bin/sh -e
# Make sure resolvconf will still work with symlinked resolv.conf

if [ -L /target/etc/resolv.conf ] && [ -f /target/run/resolvconf/resolv.conf ]; then
    mkdir -p /run/resolvconf
    cp /target/run/resolvconf/resolv.conf /run/resolvconf/resolv.conf
    mkdir -p /etc/resolvconf/run/
    cp /target/run/resolvconf/resolv.conf /etc/resolvconf/run/resolv.conf
fi
