system/trust - link location could be a file or link, but when it exists, it should be removed. fixes:

Scanning /usr/share/certs/trusted for certificates...
Scanning /usr/local/share/certs for certificates...
Traceback (most recent call last):
  File "/usr/local/opnsense/scripts/system/certctl.py", line 195, in <module>
    cmds[sys.argv[1]]()
  File "/usr/local/opnsense/scripts/system/certctl.py", line 152, in cmd_rehash
    os.symlink(src_filename, dst_filename)
FileExistsError: [Errno 17] File exists:
This commit is contained in:
Ad Schellevis 2024-10-07 19:46:13 +02:00
parent 96a37c2763
commit 9a33aeb07e

View File

@ -147,7 +147,7 @@ def cmd_rehash():
f_out.write(record['data'])
os.chmod(dst_filename, 0o644)
else:
if os.path.isfile(dst_filename):
if os.path.isfile(dst_filename) or os.path.islink(dst_filename):
os.remove(dst_filename)
os.symlink(src_filename, dst_filename)