]> ToastFreeware Gitweb - toast/tdyndns.git/blobdiff - cgi-bin/dyndns.py
update docs after renames
[toast/tdyndns.git] / cgi-bin / dyndns.py
index cb48a188c21d4b8d2c1a2b7a21bb50314c45e845..5cbf1cee2d2ece5b71606fe3a94f0c478a111abf 100755 (executable)
@@ -71,6 +71,9 @@ class MyipInvalid(MyipError):
 class OfflineInvalid(DynDnsError):
        returncode = 'badparam' # not documented at dyn.com
 
+class NsupdateError(DynDnsError):
+       returncode = 'nohost'
+
 
 fields = cgi.FieldStorage()
 
@@ -159,13 +162,15 @@ try:
                        raise MyipInvalid()
 
        # update bind
-       call_params = ['sudo', '/usr/local/bin/nsupdate_dyndns']
+       call_params = ['sudo', 'nsupdate_dyndns']
        if offline:
                call_params.append('--delete')
        if myip is not None:
                call_params.extend(['--ip', myip])
        call_params.append(hostname)
-       call(call_params)
+       retcode = call(call_params)
+       if retcode != 0:
+               raise NsupdateError()
 
        # return success
        print "Content-Type: text/html"