Add IPCOMMAND directive

Added "IPCOMMAND" to provide a way to specify the IP without using curl.
This commit is contained in:
NyneR
2021-12-11 17:49:20 +01:00
parent 540affcf62
commit 5d7c9f0ca4
2 changed files with 8 additions and 1 deletions

View File

@@ -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\"?>