diff --git a/src/main-verify.py b/src/main-verify.py index 9f73e38..be107c5 100644 --- a/src/main-verify.py +++ b/src/main-verify.py @@ -79,6 +79,7 @@ def main(): # Check any_verified = False + any_failed = False for path in infiles: # Remove the directory and the extension from the file name = os.path.basename(path) @@ -92,6 +93,8 @@ def main(): if len(success) > 0: any_verified = True + if len(fail) > 0: + any_fail = True for match_host, match_port, match_comment in success: # Use for display the same normalzed format as internally @@ -117,8 +120,8 @@ def main(): for _, _, same_fingerprint_comment in same_fingerprint: print('[same fingerprint] %s: (unknown host): %s' % (name, same_fingerprint_comment)) - # Exit with 0 only if it was verified - if any_verified: + # Exit with 0 only if it was verified and didn't fail + if any_verified and not any_fail: sys.exit(0) else: sys.exit(2)