用于操纵fear.org DDN的命令行工具
pyafraid的Python项目详细描述
PyFerr是一个命令行工具,用于更新ferr.org DDNS服务的IP地址。
安装
pyford可以使用标准的python setup.py install命令安装:
$ [sudo] python setup.py install
用法
安装后,只需运行:
$ pyafraid update|query <username> -p <password> -n <hostname>
或者,如果您想使用sha-1散列而不是 用户名/密码组合键:
$ pyafraid update|query -s <sha_hash> -n <hostname>
有关更详细的用法说明,请使用--help/-h选项:
$ pyafraid -h Usage: pyafraid.py update|query [-h] [-u <username>] [-p <password>] [-n <hostname>] Options: -h, --help show this help message and exit -u USERNAME, --username=USERNAME The freedns.afraid.org username -p PASSWORD, --password=PASSWORD The associated password -n HOSTNAME, --hostname=HOSTNAME The name of the host to update or query -s SHA_HASH, --sha-hash=SHA_HASH The SHA-1 hash from the API interface URL. Don't use this with the -u and -p options.
例如,要更新freedns.ferd.org以指向当前IP地址, 使用update参数:
$ pyafraid update -u myuser -p mypass -n mythbox.example.org Attempting to update mythbox.example.org... response from server: ERROR: Address 1.1.1.1 has not changed.
要查询freedns.ferd.org以获取有关帐户的信息,可以使用query参数:
$ pyafraid query -u myuser -p mypass url: http://freedns.afraid.org/dynamic/update.php?<some_hash> ip: 1.1.1.1 desc: example.org url: http://freedns.afraid.org/dynamic/update.php?<some_other_hash> ip: 2.2.2.2 desc: deathstar.example.org
请注意,指定-n/--hostname将限制对给定主机的输出。
使用要求
PyForder只在Python2.6上进行了积极的测试,但是应该在Python2.2+上进行一些小的更改。 欢迎使用修补程序:)
开发要求
- 要执行单元测试(使用“make test”),需要以下模块:
- 单元测试2
- 探索
- 模拟
所有这些模块都可以用easy_install:
安装$ [sudo] easy_install mock unittest2 discover
报告错误
任何错误都可以在github(https://github.com/campbellr/pyafraid/issues/new)上报告 或者发邮件给campbellr@gmail.com。