Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomTurnschuh <36013390+TomTurnschuh@users.noreply.github.com>2018-10-07 18:24:38 +0300
committernachoparker <nacho@ownyourbits.com>2018-10-07 18:24:38 +0300
commitc6da8a9c565675085b5b1ab6ce8f5f19ff88f2fb (patch)
tree94baca41ce46c0062f70c540bb7578db53acd3b1
parent54e09689ce236b4e55bfbc60f8184a158eac415f (diff)
Use DIG instead of NSLOOKUP in DDNS apps (#666)v0.62.8
-rw-r--r--etc/ncp-config.d/DDNS_freeDNS.sh2
-rw-r--r--etc/ncp-config.d/DDNS_spDYN.sh4
2 files changed, 3 insertions, 3 deletions
diff --git a/etc/ncp-config.d/DDNS_freeDNS.sh b/etc/ncp-config.d/DDNS_freeDNS.sh
index 9c77ae5f..713bda20 100644
--- a/etc/ncp-config.d/DDNS_freeDNS.sh
+++ b/etc/ncp-config.d/DDNS_freeDNS.sh
@@ -34,7 +34,7 @@ configure()
#!/bin/bash
echo "FreeDNS client started"
echo "${URL}"
-registeredIP=\$(nslookup ${DOMAIN_}|tail -n2|grep A|sed s/[^0-9.]//g)
+registeredIP=$(dig +short "$DOMAIN_"|tail -n1)
currentIP=\$(wget -q -O - http://checkip.dyndns.org|sed s/[^0-9.]//g)
[ "\$currentIP" != "\$registeredIP" ] && {
wget -q -O /dev/null ${URL}
diff --git a/etc/ncp-config.d/DDNS_spDYN.sh b/etc/ncp-config.d/DDNS_spDYN.sh
index c1736329..2491a749 100644
--- a/etc/ncp-config.d/DDNS_spDYN.sh
+++ b/etc/ncp-config.d/DDNS_spDYN.sh
@@ -87,7 +87,7 @@ if [ $# -eq 3 ]
then
# if hostname and token
# Get registered IP address
- registeredIP=\$(nslookup ${DOMAIN_}|tail -n2|grep A|sed s/[^0-9.]//g)
+ registeredIP=$(dig +short "$DOMAIN_"|tail -n1)
# Get current IP address
currip=$(curl -s "$get_ip_url");
# Update only when IP address has changed.
@@ -102,7 +102,7 @@ if [ $# -eq 3 ]
then
# if hostname and user and passwd
# Get registered IP address
- registeredIP=\$(nslookup ${DOMAIN_}|tail -n2|grep A|sed s/[^0-9.]//g)
+ registeredIP=$(dig +short "$DOMAIN_"|tail -n1)
# Get current IP address
currip=$(curl -s "$get_ip_url");
# Update only when IP address has changed.