run/load/ipxe: prevent error on kill_spawned

... if the run script exits early.
This commit is contained in:
Christian Helmuth 2023-03-03 11:30:59 +01:00
parent 23cc96e661
commit 182ba3a931

View File

@ -106,7 +106,8 @@ rename exit load_ipxe_real_exit
proc exit {{status 0}} {
if {[load_ipxe_lighttpd]} {
global lighttpd_spawn_id
kill_spawned $lighttpd_spawn_id
# variable may not exist if the script fails early
if {[info exists lighttpd_spawn_id]} { kill_spawned $lighttpd_spawn_id }
}
load_ipxe_real_exit $status