From e3a61d3eb67da6590395ab4f90855e632f1f7f5d Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Sat, 16 Mar 2024 07:30:32 +0100 Subject: [PATCH] fix: exit with 1 when handler mismatches type --- nyacme/hook.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nyacme/hook.py b/nyacme/hook.py index b676525..5eb7c65 100644 --- a/nyacme/hook.py +++ b/nyacme/hook.py @@ -38,6 +38,10 @@ def main() -> None: handler_name = config.get_handler(zone_name) handler = handlers[handler_name](zone_name, config, args.token) + if (args.type == 'dns-01') == (handler_name == 'http'): + log.error('wrong handler for type, try again') + sys.exit(1) + if args.method == 'begin': handler.create(short_record_name, args.auth) else: