Skip to content

Commit

Permalink
Add IPCOMMAND directive
Browse files Browse the repository at this point in the history
Added "IPCOMMAND" to provide a way to specify the IP without using curl.
  • Loading branch information
NyneR committed Dec 11, 2021
1 parent 540affc commit 5d7c9f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions nsupdate.d/dist.config.sample
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ LOG="$0.log"
# inspecting the target URL of the save button.
#INWX_DOMAIN_ID="123456789"

# Provide a command to get the Ip instead of using Curl
#IPCOMMAND=""

# Use IPv6 connection.
# deprecated option for backward compatibility, use TYPE instead
#IPV6="NO"
Expand Down
6 changes: 5 additions & 1 deletion nsupdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ if ls $(dirname $0)/nsupdate.d/*.config &> /dev/null; then
fi

# WAN_IP=`curl -s -$CONNECTION_TYPE ${IP_CHECK_SITE}| grep -Eo '\<[[:digit:]]{1,3}(\.[[:digit:]]{1,3}){3}\>'`
WAN_IP=$(curl -s -$CONNECTION_TYPE ${IP_CHECK_SITE})
if [[ -n "$IPCOMMAND" ]]; then
WAN_IP=$($IPCOMMAND)
else
WAN_IP=$(curl -s -$CONNECTION_TYPE ${IP_CHECK_SITE})
fi

# This is relevant for getting the specific domain record id.
API_XML_INFO="<?xml version=\"1.0\"?>
Expand Down

0 comments on commit 5d7c9f0

Please sign in to comment.