From: Philipp Spitzer Date: Wed, 5 Mar 2014 21:53:07 +0000 (+0100) Subject: zone is now a configuration variable X-Git-Tag: 0.0.2~33 X-Git-Url: https://git.toastfreeware.priv.at/toast/tdyndns.git/commitdiff_plain/e83c19c846a3bb05c673be9bccf01de3ca5b6566 zone is now a configuration variable --- diff --git a/cgi-bin/dyndns.py b/cgi-bin/dyndns.py index 6087beb..f9919dd 100755 --- a/cgi-bin/dyndns.py +++ b/cgi-bin/dyndns.py @@ -12,6 +12,7 @@ import ipaddr # Configuration PASSWORD = 'hygCithOrs5' +ZONE = '.dyn.colgarra.priv.at' # Just for debugging: @@ -27,7 +28,9 @@ hostname = fields.getvalue('hostname') myip = fields.getvalue('myip') # Strip zone -hostname = re.sub('\.dyn\.colgarra\.priv\.at\s*$', '', hostname) +hostname = hostname.strip() +if hostname.endswith(ZONE): + hostname = hostname[:-len(ZONE)] try: # check username