From owner-svn-ports-all@freebsd.org Tue Sep 11 17:55:09 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBB321098386; Tue, 11 Sep 2018 17:55:09 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 61D8081812; Tue, 11 Sep 2018 17:55:09 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57A7F1B267; Tue, 11 Sep 2018 17:55:09 +0000 (UTC) (envelope-from crees@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8BHt91e068548; Tue, 11 Sep 2018 17:55:09 GMT (envelope-from crees@FreeBSD.org) Received: (from crees@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8BHt9St068547; Tue, 11 Sep 2018 17:55:09 GMT (envelope-from crees@FreeBSD.org) Message-Id: <201809111755.w8BHt9St068547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: crees set sender to crees@FreeBSD.org using -f From: Chris Rees Date: Tue, 11 Sep 2018 17:55:09 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r479536 - in head/dns/namesilo_ddns: . files X-SVN-Group: ports-head X-SVN-Commit-Author: crees X-SVN-Commit-Paths: in head/dns/namesilo_ddns: . files X-SVN-Commit-Revision: 479536 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Sep 2018 17:55:10 -0000 Author: crees Date: Tue Sep 11 17:55:08 2018 New Revision: 479536 URL: https://svnweb.freebsd.org/changeset/ports/479536 Log: Upstream patch; fix use when multiple types are in use from one domain/host Added: head/dns/namesilo_ddns/files/ head/dns/namesilo_ddns/files/patch-eb8e01 (contents, props changed) Modified: head/dns/namesilo_ddns/Makefile Modified: head/dns/namesilo_ddns/Makefile ============================================================================== --- head/dns/namesilo_ddns/Makefile Tue Sep 11 16:41:02 2018 (r479535) +++ head/dns/namesilo_ddns/Makefile Tue Sep 11 17:55:08 2018 (r479536) @@ -2,6 +2,7 @@ PORTNAME= namesilo_ddns PORTVERSION= 2.1 +PORTREVISION= 1 DISTVERSIONPREFIX=v CATEGORIES= dns net Added: head/dns/namesilo_ddns/files/patch-eb8e01 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/dns/namesilo_ddns/files/patch-eb8e01 Tue Sep 11 17:55:08 2018 (r479536) @@ -0,0 +1,41 @@ +From eb8e0195483a91c06543d6f680898dc7d5baba50 Mon Sep 17 00:00:00 2001 +From: Chris Rees +Date: Tue, 11 Sep 2018 18:50:59 +0100 +Subject: [PATCH] Fix use case where A and MX records (for example) exist for + the same domain + +diff --git a/README.md b/README.md +index 8b3f27e..1c18fde 100644 +--- a/README.md ++++ b/README.md +@@ -1,5 +1,5 @@ + ----------------------------------------------------------------- +-# namesilo_ddns version 2.0 ++# namesilo_ddns version 2.1_1 + Dynamic DNS record update with NameSilo. + + This is a shell script to update Namesilo's DNS record when IP changed. Set to run this script as cronjob in your system. +diff --git a/namesilo_ddns.sh b/namesilo_ddns.sh +index 741956e..ab1e0c3 100644 +--- a/namesilo_ddns.sh ++++ b/namesilo_ddns.sh +@@ -1,6 +1,6 @@ + #!/bin/sh + +-# namesilo_ddns version 2.0 ++# namesilo_ddns version 2.1_1 + + ##For security, you should use a config file readable only by the user + ##calling this utility (root may not be such a great idea). There is an example +@@ -124,7 +124,7 @@ if [ "$CUR_IP" != "$KNOWN_IP" ]; then + + ##Update DNS record in Namesilo: + $CURL "https://www.namesilo.com/api/dnsListRecords?version=1&type=xml&key=$APIKEY&domain=$DOMAIN" > /tmp/$DOMAIN.xml +- RECORD_ID=`xmllint --xpath "//namesilo/reply/resource_record/record_id[../host/text() = '$HOST_DOT$DOMAIN' ]" /tmp/$DOMAIN.xml` ++ RECORD_ID=`xmllint --xpath "//namesilo/reply/resource_record/record_id[../host/text() = '$HOST_DOT$DOMAIN' ][../type = 'A' ]" /tmp/$DOMAIN.xml` + RECORD_ID=${RECORD_ID#*>} + RECORD_ID=${RECORD_ID%<*} + $CURL "https://www.namesilo.com/api/dnsUpdateRecord?version=1&type=xml&key=$APIKEY&domain=$DOMAIN&rrid=$RECORD_ID&rrhost=$HOST&rrvalue=$CUR_IP&rrttl=$TTL" > $RESPONSE +-- +2.16.2 +