diff options
| author | Kyle Evans <kevans@FreeBSD.org> | 2018-02-24 04:02:06 +0000 |
|---|---|---|
| committer | Kyle Evans <kevans@FreeBSD.org> | 2018-02-24 04:02:06 +0000 |
| commit | eed91cae685e7456eb127d96dc5ad4c1c2df194a (patch) | |
| tree | 00815807bdf6d5e864b234a7a7059ca36b83b2d1 /stand/lua/config.lua | |
| parent | d709f254c2b016f6c40442f9523d2ed758963921 (diff) | |
Notes
Diffstat (limited to 'stand/lua/config.lua')
| -rw-r--r-- | stand/lua/config.lua | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/stand/lua/config.lua b/stand/lua/config.lua index 46b911228815..98185d89cc23 100644 --- a/stand/lua/config.lua +++ b/stand/lua/config.lua @@ -140,12 +140,17 @@ local function check_nextboot() nextboot_file .. "'") end + -- Attempt to rewrite the first line and only the first line of the + -- nextboot_file. We overwrite it with nextboot_enable="NO", then + -- check for that on load. See: check_nextboot_enabled + -- It's worth noting that this won't work on every filesystem, so we + -- won't do anything notable if we have any errors in this process. local nfile = io.open(nextboot_file, 'w') 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. + -- We need the trailing space here to account for the extra + -- character taken up by the string nextboot_enable="YES" + -- Or new end quotation mark lands on the S, and we want to + -- rewrite the entirety of the first line. io.write(nfile, "nextboot_enable=\"NO\" ") io.close(nfile) end |
