Software /
code /
prosody
Diff
util/prosodyctl/cert.lua @ 13518:0ef9c26d9d96 0.12
util.prosodyctl.cert: Ensure old cert is moved out of the way
This should make it visible if the move fails
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 30 Aug 2024 17:41:40 +0200 |
parent | 12387:05c250fa335a |
child | 13520:662dfff658a0 |
line wrap: on
line diff
--- a/util/prosodyctl/cert.lua Sun Aug 18 16:58:30 2024 +0200 +++ b/util/prosodyctl/cert.lua Fri Aug 30 17:41:40 2024 +0200 @@ -163,7 +163,7 @@ local attrs = lfs.attributes(to); if attrs then -- Move old file out of the way local backup = to..".bkp~"..os.date("%FT%T", attrs.change); - os.rename(to, backup); + assert(os.rename(to, backup)); end -- FIXME friendlier error handling, maybe move above backup back? local input = assert(io.open(from));