diff --git a/README.pod b/README.pod index eaa5948..1ce2f96 100644 --- a/README.pod +++ b/README.pod @@ -13,6 +13,13 @@ L; the software goals are for simplicity, flexibility and configurability while using the minimal system tools installed with most distributions. + Version 1.x = FreeDNS API v1 + Version 2.x = FreeDNS API v2 + +If upgrading from API v1 to v2, a manual action is required on the +FreeDNS website to generate a new API key for each domain name. See +L for more information. + =head1 OPTIONS =over 4 diff --git a/petrified b/petrified index eeffe30..b87f0e6 100755 --- a/petrified +++ b/petrified @@ -2,7 +2,7 @@ # ## petrified - bash client to update dynamic DNS at freedns.afraid.org ## Copyright (c) 2015 Troy Engel -## Version: 1.0.6 +## Version: 2.0.0 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,8 +37,8 @@ while getopts ":c:" opt; do esac done -## How to update DNS - DDNS_KEY is unique per domain -DDNS_URL=https://freedns.afraid.org/dynamic/update.php +## v2 API - How to update DNS - DDNS_KEY is unique per domain +DDNS_URL=https://sync.afraid.org/u/ DDNS_KEY="" ## Which URL to use to get an IP @@ -215,7 +215,7 @@ fi # If they don't match, tell upstream if [[ "${OLDIP}" != "${NEWIP}" ]]; then - UPDURL="${DDNS_URL}?${DDNS_KEY}&address=${NEWIP}" + UPDURL="${DDNS_URL}${DDNS_KEY}/?ip=${NEWIP}" RESULT=$(curl -m ${CURL_WAIT} -sk "${UPDURL}" 2>/dev/null) logmsg "${RESULT}" else diff --git a/petrified.1 b/petrified.1 index d3f8b43..9285d2c 100644 --- a/petrified.1 +++ b/petrified.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) +.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== @@ -46,7 +46,7 @@ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" -.\" If the F register is turned on, we'll generate index entries on stderr for +.\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. @@ -54,20 +54,16 @@ .\" Avoid warning from groff about undefined register 'F'. .de IX .. -.nr rF 0 -.if \n(.g .if rF .nr rF 1 -.if (\n(rF:(\n(.g==0)) \{ -. if \nF \{ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" +.if !\nF .nr F 0 +.if \nF>0 \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" .. -. if !\nF==2 \{ -. nr % 0 -. nr F 2 -. \} +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 . \} .\} -.rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. @@ -133,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "PETRIFIED 1" -.TH PETRIFIED 1 "2016-01-24" "petrified 1.0.6" "Petrified Manual" +.TH PETRIFIED 1 "2017-09-16" "petrified 2.0.0" "Petrified Manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -149,6 +145,15 @@ Usage: \fBpetrified\fR [ \fB\-c\fR \fIconfig\fR ] ; the software goals are for simplicity, flexibility and configurability while using the minimal system tools installed with most distributions. +.PP +.Vb 2 +\& Version 1.x = FreeDNS API v1 +\& Version 2.x = FreeDNS API v2 +.Ve +.PP +If upgrading from \s-1API\s0 v1 to v2, a manual action is required on the +FreeDNS website to generate a new \s-1API\s0 key for each domain name. See + for more information. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-c\fR \fIconfig\fR" 4 diff --git a/petrified.conf b/petrified.conf index 45b450b..cd15ef1 100644 --- a/petrified.conf +++ b/petrified.conf @@ -14,11 +14,11 @@ # This is the unique string for the dynamic DNS entry to update; visit -# http://freedns.afraid.org/dynamic/ - next to the DNS entries towards -# the bottom is a link "Direct URL"; copy that and extract the string -# after the '...update.php?' part and put here. +# https://freedns.afraid.org/dynamic/v2/ - next to the DNS entries towards +# the bottom is a link to sync.afraid.org; copy that and extract the string +# after the '.../u/' part and put here. # -# Example: DDNS_KEY=9C4yjq3kaekkYNbYsKRqcosTmouMYbfVMLkJtR== +# Example: DDNS_KEY=ZIfSWnXKuDqMpNEsTXBA852 DDNS_KEY= # Which URL to use to get an IP - the expectation is output from this