diff --git a/stand/lua/config.lua b/stand/lua/config.lua index 5c3d25031244..46b911228815 100644 --- a/stand/lua/config.lua +++ b/stand/lua/config.lua @@ -141,8 +141,14 @@ local function check_nextboot() end local nfile = io.open(nextboot_file, 'w') - io.write(nfile, "nextboot_enable=\"NO\" ") - io.close(nfile) + if nfile ~= nil then + -- We're overwriting the first line of the file, so we need the + -- trailing space to account for the extra character taken up by + -- the string nextboot_enable="YES" -- our new end quotation + -- mark lands on the S. + io.write(nfile, "nextboot_enable=\"NO\" ") + io.close(nfile) + end end -- Module exports