Newer
Older
certbot-dns-inwx / certbot-dns-clean.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu May 31 17:23:20 2018

@author: Pascal Gollor (https://gitbucket.pgollor.de)
"""


import os, sys, time


def main():
	d = os.environ.get('CERTBOT_DOMAIN')
	if (not d):
		sys.exit('CERTBOT_DOMAIN not set!')
	# end if

	v = os.environ.get('CERTBOT_VALIDATION')
	if (not v):
		sys.exit('CERTBOT_VALIDATION not set!')
	# end if

	# check domain
	if (d.count('.') > 1):
		sys.exit('Subdomains not supported!')
	# end if

	dirName = os.path.dirname(os.path.abspath(sys.argv[0]))
	cmd = dirName + "/update-record.py -m delete -c " + dirName + "/conf.cfg" + " -r TXT _acme-challenge." + d;
	os.system(cmd)
# end main


if __name__ == '__main__':
	main()
# end if