diff --git a/certbot-dns-auth.sh b/certbot-dns-auth.sh new file mode 100755 index 0000000..d919891 --- /dev/null +++ b/certbot-dns-auth.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +python update-record.py -r TXT _acme-challenge.${CERTBOT_DOMAIN} $CERTBOT_VALIDATION diff --git a/update-record.py b/update-record.py index 0c57254..a493ded 100755 --- a/update-record.py +++ b/update-record.py @@ -7,9 +7,8 @@ ############################################################################# ###### This is an example of how to use the inwx class ####### -from inwx.inwx import domrobot, prettyprint +from inwx.inwx import domrobot#, prettyprint from inwx.configuration import get_account_data -import sys import argparse @@ -51,7 +50,7 @@ subId = -1 ret = inwx_conn.nameserver.info({'domain': domain}) records = ret['resData']['record'] - + for r in records: if (r['name'] == args.domain): subId = r['id'] @@ -67,7 +66,7 @@ # end if if (subId < 0): - ret = inwx_conn.nameserver.createRecord({'domain': domain, 'name': sub, 'type': args.record_type,'content': str(args.content), 'ttl': args.ttl}) + ret = inwx_conn.nameserver.createRecord({'domain': domain, 'name': sub, 'type': args.record_type, 'content': str(args.content), 'ttl': args.ttl}) else: ret = inwx_conn.nameserver.updateRecord({'id': subId, 'type': args.record_type, 'content': str(args.content), 'ttl': args.ttl}) # end if @@ -88,7 +87,7 @@ parser.add_argument('-c', '--config_file', metavar='path', default='./conf.cfg', help='path to configuration file') parser.add_argument('-t', '--ttl', default=3600, type=int, help='TTL (time to live) of the nameserver record in seconds (default 3600)') - parser.add_argument('-s', '--config_section', metavar='section', default='ote', choices=['live', 'ote'], help='configuration section (live, ote)') + parser.add_argument('-s', '--config_section', metavar='section', default='ote', choices=['live', 'ote'], help='configuration section (live, ote) default: ote') parser.add_argument('-l', '--language', metavar='lang', default='en', choices=['de', 'en'], help='answer language (de, en)') parser.add_argument('-v', '--verbose', action='store_true', help='verbose') parser.add_argument('-d', '--debug', action='store_true', help='debug')