Skip to main content

Command-line tool for manipulating afraid.org DDNS

Project description

pyafraid is a command-line tool for updating IP addresses for the afraid.org DDNS service.

Installation

pyafraid can be installed using the standard python setup.py install command:

$ [sudo] python setup.py install

Usage

Once installed, simply run:

$ pyafraid update|query <username> -p <password> -n <hostname>

Or, if you’d like to use the SHA-1 hash instead of the username/password combo:

$ pyafraid update|query -s <sha_hash> -n <hostname>

For a more detailed usage description, use the --help/-h option:

$ 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.

For example, to update freedns.afraid.org to point to the current IP address, use the update argument:

$ 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.

To query freedns.afraid.org for information about an account, you can use the query argument:

$ 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

Note that specifying -n/--hostname will restrict the output to the given host.

Usage Requirements

pyafraid has only been actively tested on python 2.6, but should work with minor changes on python 2.2+. Patches are welcomed :)

Development Requirements

In order to execute unit tests (using ‘make test’) the following modules are required:
  • unittest2

  • discover

  • mock

All of these modules can be installed with easy_install:

$ [sudo] easy_install mock unittest2 discover

Reporting Bugs

Any bugs can be reported on github (https://github.com/campbellr/pyafraid/issues/new) or emailed to campbellr@gmail.com.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyafraid-0.1.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file pyafraid-0.1.tar.gz.

File metadata

  • Download URL: pyafraid-0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyafraid-0.1.tar.gz
Algorithm Hash digest
SHA256 288a77f4d98f34a860e2800d3246bcaf5a39481638e23a1f0ec00c7a215ea2c6
MD5 2a5dd02884a0185a26a2ce676dc8b579
BLAKE2b-256 1c7b026b472ca8f4e6ba5f4cd4991def2b027c60794bae89688f2821802fb59b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page