X-Git-Url: https://git.toastfreeware.priv.at/toast/tdyndns.git/blobdiff_plain/912587ddea708570052ff0d5cdbd3a3102574c09..026b856d6d00092a7e998c328cda23b77ffd811e:/bin/tdyndns_update?ds=sidebyside diff --git a/bin/tdyndns_update b/bin/tdyndns_update index 8f943f8..ce0b73a 100755 --- a/bin/tdyndns_update +++ b/bin/tdyndns_update @@ -6,12 +6,16 @@ from subprocess import Popen, PIPE, call import ipaddr -class NsupdateError(Exception): +class ExternalProgramError(RuntimeError): + pass + + +class NsupdateError(ExternalProgramError): def __init__(self, returncode): self.returncode = returncode -class BlockipError(Exception): +class BlockipError(ExternalProgramError): def __init__(self, returncode): self.returncode = returncode @@ -82,7 +86,7 @@ def main(args): nsupdate_add(args.fqdn, args.ttl, args.ip) if ipfamily_by_ip(args.ip) == 'A': blockip_whitelist_add(args.ip) - except NsupdateError as e: + except ExternalProgramError as e: sys.exit(e.returncode)