Commit 51b7ed7f authored by Christian Hesse's avatar Christian Hesse 😜 Committed by Gerardo Exequiel Pozzi
Browse files

only run pxe late hook if $ip is given


Signed-off-by: Christian Hesse's avatarChristian Hesse <mail@eworm.de>
parent ca85896b
......@@ -47,12 +47,14 @@ run_hook () {
}
run_latehook () {
[[ -z "${copy_resolvconf}" ]] && copy_resolvconf="y"
if [[ -n "${ip}" ]]; then
[[ -z "${copy_resolvconf}" ]] && copy_resolvconf="y"
if [[ "${copytoram}" == "y" ]]; then
ip addr flush ${bootif_dev}
ip link set ${bootif_dev} down
elif [[ "${copy_resolvconf}" != "n" && -f /etc/resolv.conf ]]; then
cp /etc/resolv.conf /new_root/etc/resolv.conf
if [[ "${copytoram}" == "y" ]]; then
ip addr flush ${bootif_dev}
ip link set ${bootif_dev} down
elif [[ "${copy_resolvconf}" != "n" && -f /etc/resolv.conf ]]; then
cp /etc/resolv.conf /new_root/etc/resolv.conf
fi
fi
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment