Last active
December 17, 2015 08:49
-
-
Save plaetzchen/5582584 to your computer and use it in GitHub Desktop.
This are a collection of python scripts to use a little server and a fritzbox to set NS entries on inwx.de
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[live] | |
url = https://api.domrobot.com/xmlrpc/ | |
username = username | |
password = password | |
[ote] | |
url = https://api.ote.domrobot.com/xmlrpc/ | |
username = your_ote_username | |
password = your_ote_password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bottle import route, run, get, request | |
from inwx import domrobot | |
from configuration import get_account_data | |
PASSWORD = "blafoo" | |
@route('/') | |
def index(): | |
newip = request.query.newip | |
remotePassword = request.query.password | |
if remotePassword == PASSWORD: | |
api_url, username, password = get_account_data(True) | |
inwx_conn = domrobot(api_url, False) | |
loginRet = inwx_conn.account.login({'lang': 'en', 'user': username, 'pass': password}) | |
inwx_conn.nameserver.updateRecord({'id':'1234567','content':newip}) | |
return 'Updated IP to ', newip | |
else: | |
return 'No.' | |
run(host='0.0.0.0', port=8080, debug=False) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bottle==0.11.6 | |
wsgiref==0.1.2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment