From 2b7521c7f124aad3396119c7d81c4797b5c2b9b4 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sun, 12 Apr 2020 12:45:15 -0400 Subject: acmens.py: Update arguments to acmens.py Now CSR path needs to be given via the --csr switch. --- README.md | 2 +- acmens.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6be74ce..8f59d6d 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ account private key, email address, and the domain CSR. The paths can be relative or absolute. ```sh -python3 acmens.py --account-key user.key --email mail@example.com domain.csr > signed.crt +python3 acmens.py --account-key user.key --email mail@example.com --csr domain.csr > signed.crt ``` When you run the script, it will: diff --git a/acmens.py b/acmens.py index c2ea739..e371432 100644 --- a/acmens.py +++ b/acmens.py @@ -247,9 +247,13 @@ $ python3 acmens.py --account-key user.key --email user@example.com domain.csr > """) parser.add_argument("-k", "--account-key", required=True, help="path to your Let's Encrypt account private key") parser.add_argument("-e", "--email", default=None, help="contact email, default is webmaster@") - parser.add_argument("csr_path", help="path to your certificate signing request") + parser.add_argument("--csr", help="path to your certificate signing request") args = parser.parse_args() - signed_crt = sign_csr(args.account_key, args.csr_path, email=args.email) + if args.csr is None: + sys.stderr.write('Error: Path to CSR required\n') + sys.exit(1) + + signed_crt = sign_csr(args.account_key, args.csr, email=args.email) sys.stdout.write(signed_crt) -- cgit v1.2.3