diff --git a/bin/ncp/NETWORKING/dynuDNS.sh b/bin/ncp/NETWORKING/dynuDNS.sh new file mode 100644 index 000000000..ccbad0c77 --- /dev/null +++ b/bin/ncp/NETWORKING/dynuDNS.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +# DynuDNS updater client installation on Raspbian +# +# Copyleft 2022 by Stefano Guandalini +# GPL licensed (see end of file) * Use at your own risk! +# + + + +install() +{ + apt-get update + apt-get install --no-install-recommends -y dnsutils +} + +configure() +{ + local updateurl=https://api.dynu.com/nic/update + local url="${updateurl}?hostname=${DOMAIN}&myipv6=${MYIPV6}&password=${PASSWORD}" + + [[ $ACTIVE != "yes" ]] && { + rm -f /etc/cron.d/dynuDNS + service cron restart + echo "dynuDNS client is disabled" + return 0 + } + + cat > /usr/local/bin/dynudns.sh < /etc/cron.d/dynuDNS + chmod 644 /etc/cron.d/dynuDNS + service cron restart + + set-nc-domain "$DOMAIN" + + echo "DynuDNS client is enabled" +} + +# License +# +# This script is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This script is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this script; if not, write to the +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, +# Boston, MA 02111-1307 USA diff --git a/etc/ncp-config.d/dynuDNS.cfg b/etc/ncp-config.d/dynuDNS.cfg new file mode 100644 index 000000000..7d66579e1 --- /dev/null +++ b/etc/ncp-config.d/dynuDNS.cfg @@ -0,0 +1,40 @@ +{ + "id": "dynuDNS", + "name": "Dynamic DNS from dynuDNS", + "title": "dynuDNS", + "description": "DynuDNS DynamicDNS service", + "info": "Need account from https://www.dynu.com/", + "infotitle": "", + "params": [ + { + "id": "ACTIVE", + "name": "Active", + "value": "no", + "type": "bool" + }, + { + "id": "PASSWORD", + "name": "Password (better UpdateIP hashed)", + "value": "", + "suggest": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJK1234567" + }, + { + "id": "MYIPV6", + "name": "IPv6 address (no == no update)", + "value": "no", + "suggest": "IPv6 address or 'no' not to update" + }, + { + "id": "DOMAIN", + "name": "Domain", + "value": "mynextcloud.example.com", + "suggest": "mynextcloud.example.com" + }, + { + "id": "UPDATEINTERVAL", + "name": "Update periodicity (in minutes)", + "value": "30", + "suggest": "30" + } + ] +} diff --git a/updates/1.46.0.sh b/updates/1.46.0.sh index 37b919904..c18c2dd5c 100644 --- a/updates/1.46.0.sh +++ b/updates/1.46.0.sh @@ -1,3 +1,6 @@ +#!/bin/bash + +set -e # docker images only [[ -f /.docker-image ]] && { @@ -8,7 +11,7 @@ ncc notify_push:self-test || { killall notify_push sleep 1 start_notify_push -}" +} EOF chmod +x /etc/cron.daily/refresh_notify_push } @@ -41,3 +44,6 @@ EOF systemctl enable refresh_notify_push.{path,service} systemctl restart refresh_notify_push.path } + + +exit 0