fix: unlink the path before linking it again

This commit is contained in:
ptrcnull 2024-03-16 20:08:39 +01:00
parent 0dca02cee6
commit 1d4672943d
Signed by: ptrcnull
GPG key ID: 411F7B30801DD9CA
2 changed files with 4 additions and 1 deletions

View file

@ -66,6 +66,7 @@ def main() -> None:
domain_key = os.path.join(args.output, f'{domain}/cert.pem.key')
domain_pem = os.path.join(args.output, f'{domain}/cert.pem')
os.unlink(domain_key)
os.link(private_key, domain_key)
# TODO: add user/group to config
shutil.chown(domain_key, 'acme', 'acme')
@ -74,7 +75,9 @@ def main() -> None:
all_pem = os.path.join(args.output, f'all/{domain}.pem')
all_key = os.path.join(args.output, f'all/{domain}.pem.key')
os.unlink(all_pem)
os.link(domain_pem, all_pem)
os.unlink(all_key)
os.link(domain_key, all_key)
if acquired:

View file

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "nyacme"
version = "0.1.8"
version = "0.1.9"
authors = [
{name = "Patrycja Rosa", email = "python@ptrcnull.me"},
]