From a383331f57d31d393a8d042bc1ce1a3aea6613fb Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 8 Oct 2024 08:41:20 +0200 Subject: [PATCH] system: improve context of changed/modified message in certctl.py --- src/opnsense/scripts/system/certctl.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/opnsense/scripts/system/certctl.py b/src/opnsense/scripts/system/certctl.py index 555002d0b..b326964b0 100755 --- a/src/opnsense/scripts/system/certctl.py +++ b/src/opnsense/scripts/system/certctl.py @@ -26,6 +26,7 @@ ----------------------------------------------------------------------------------------------- Simple re-implementation of certctl tool in FreeBSD (only supporting the parameters we use) """ + import glob import sys import os @@ -40,7 +41,6 @@ BLACKLISTPATH = ['/usr/share/certs/untrusted', '/usr/share/certs/blacklisted', ' CERTDESTDIR = '/etc/ssl/certs' BLACKLISTDESTDIR = '/etc/ssl/blacklisted' - def certificate_iterator(filename): fext = os.path.splitext(filename)[1][1:].lower() try: @@ -160,7 +160,13 @@ def cmd_rehash(): else: os.remove(filename) changes += 1 - print("Changed %d links" % changes) + + if changes == 0: + print("certctl: No changes to trust store were made.") + elif changes == 1: + print("certctl: Modified 1 trust store link.") + else: + print("certctl: Modified %d trust store links." % changes) # link certs/crls to ports openssl version current_target_files = []