flush and set down only if boot interface is known

Signed-off-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
Christian Hesse 2016-05-28 18:20:27 +02:00 committed by Gerardo Exequiel Pozzi
parent ca288915c0
commit a9e7b0d50b

View File

@ -52,8 +52,10 @@ run_latehook () {
[[ -z "${copy_resolvconf}" ]] && copy_resolvconf="y"
if [[ "${copytoram}" == "y" ]]; then
if [[ -n "${bootif_dev}" ]]; then
ip addr flush dev "${bootif_dev}"
ip link set "${bootif_dev}" down
fi
elif [[ "${copy_resolvconf}" != "n" && -f /etc/resolv.conf ]]; then
cp /etc/resolv.conf /new_root/etc/resolv.conf
fi