diff --git a/domain-check.py b/domain-check.py index 3995660..1d67347 100755 --- a/domain-check.py +++ b/domain-check.py @@ -8,24 +8,29 @@ from inwx.inwx import domrobot, prettyprint, getOTP from inwx.configuration import get_account_data +import sys -def main(): +def main(domain): api_url, username, password, shared_secret = get_account_data(True, config_file='./conf.cfg', config_section="ote") - print("api url: " + api_url) inwx_conn = domrobot(api_url, False) loginRet = inwx_conn.account.login({'lang': 'de', 'user': username, 'pass': password}) - print(loginRet) + print("login: " + str(loginRet)) if 'resData' in loginRet: loginRet = loginRet['resData'] # end if - domain = "pgollor.de" + print("check domain: " + domain) checkRet = inwx_conn.domain.check({'domain': domain}) - print(prettyprint.domain_check(checkRet)) + print("check: " + str(prettyprint.domain_check(checkRet))) # end main if __name__ == '__main__': - main() + if (len(sys.argv) < 2): + raise ValueError("Not enough arguments.") + # end if + + domain = str(sys.argv[1]) + main(domain) # end if