X-Git-Url: https://git.ralfj.de/dyn-nsupdate.git/blobdiff_plain/a78b59b76b259407282d8e817abdc8297fa8f9f9..4c50ee5d8b2eb10d1fa5a1c8ec340fb769614ffd:/update?ds=inline diff --git a/update b/update deleted file mode 100755 index d5fbca3..0000000 --- a/update +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/python -import cgi, os, sys, subprocess -form = cgi.FieldStorage() - -# print headers -print "Content-Type: text/plain" -print "" - -# get input -if "password" not in form or "domain" not in form or "ip" not in form: - print "Mandatory argument missing: You must supply all of 'password', 'domain', 'ip'" - sys.exit() - -ip = form["ip"].value -domain = form["domain"].value -password = form["password"].value - -# run update program -p = subprocess.Popen(["/var/lib/named/dyn-nsupdate", domain, password, ip], stdout=subprocess.PIPE, stderr=subprocess.PIPE) -(stdout, stderr) = p.communicate() - -# check what it did -if p.returncode or stderr or stdout: - # error :/ - print "There was an error while updating the DNS: Return code %d" % p.returncode - if stdout: print stdout - if stderr: print stderr -else: - print "good",ip