python:simple_dyndns_updater
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | python:simple_dyndns_updater [2012/08/15 13:54] (current) – created tkbletsc | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | Syntax: dyndns-update.py < | ||
| + | < | ||
| + | |||
| + | import sys,os,re | ||
| + | import urllib, | ||
| + | |||
| + | def update(user, | ||
| + | url = " | ||
| + | return urllib.urlopen(url).read() | ||
| + | |||
| + | def local_ip(): | ||
| + | return socket.gethostbyname(socket.gethostname()) | ||
| + | |||
| + | if len(sys.argv) < 4: | ||
| + | print " | ||
| + | sys.exit(1) | ||
| + | |||
| + | (user, | ||
| + | if len(sys.argv) >= 5: | ||
| + | ip = sys.argv[4] | ||
| + | else: | ||
| + | ip = local_ip() | ||
| + | |||
| + | print " | ||
| + | print " | ||
| + | </ | ||
python/simple_dyndns_updater.txt · Last modified: by tkbletsc
