Add variomedia as new provider.
authorStefan Schantl <stefan.schantl@ipfire.org>
Sun, 15 Jun 2014 20:06:29 +0000 (22:06 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Sun, 15 Jun 2014 20:06:29 +0000 (22:06 +0200)
ddns.conf.sample
src/ddns/__init__.py
src/ddns/providers.py

index bb0e839..28aa4e5 100644 (file)
@@ -51,3 +51,9 @@
 # token = token
 # username = user
 # password = pass
+
+# [test.variomedia.de]
+# provider = variomedia.de
+# username = user
+# password = pass
+# proto = ipv4 OR ipv6
index 5172832..d91d9f0 100644 (file)
@@ -98,6 +98,7 @@ class DDNSCore(object):
                        DDNSProviderNOIP,
                        DDNSProviderLightningWireLabs,
                        DDNSProviderSelfhost,
+                       DDNSProviderVariomedia,
                ):
                        self.register_provider(provider)
 
index 8a5185f..2ac3caf 100644 (file)
@@ -489,3 +489,26 @@ class DDNSProviderSelfhost(DDNSProvider):
                match = re.search("status=20(0|4)", response.read())
                if not match:
                        raise DDNSUpdateError
+
+class DDNSProviderVariomedia(DDNSProviderDynDNS):
+       INFO = {
+               "handle"   : "variomedia.de",
+               "name"     : "Variomedia",
+               "website"  : "http://www.variomedia.de/",
+               "protocols" : ["ipv6", "ipv4",]
+       }
+
+       # Detailed information about the request can be found here
+       # https://dyndns.variomedia.de/
+
+       url = "https://dyndns.variomedia.de/nic/update"
+
+       @property
+       def proto(self):
+               return self.get("proto")
+
+       def _prepare_request_data(self):
+               data = {
+                       "hostname" : self.hostname,
+                       "myip"     : self.get_address(self.proto)
+               }