spuds1 / OpenWRT-DDNS

0 stars 0 forks source link

Bad provider address #1

Open bonez56 opened 6 months ago

bonez56 commented 6 months ago

Hi,

I've set up the script and am attempting to run it but am getting the output below:

root@router:~/OpenWRT-DDNS# ./oddns.sh 
Mon Feb 26 22:42:40 AWST 2024
  WAN: 103.106.xx.xx
    Valid IP address
  Cache is up-to-date. Using cache.
  Checking DDNS provider
Failed to parse json data: unexpected character
  Provider: 
    BAD PROVIDER ADDRESS: 
  Failed to get remote address.
root@router:~/OpenWRT-DDNS# 

The content of my provider.conf looks like this:

# =============================================================================
# Porkbun configuration for oddns.sh
# Copy this to provider.conf
# =============================================================================

# Your WAN adapter name
WAN=eth1

# Your keys
APIKEY=pk1_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# Secret key
APISEC=sk1_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Your domain
DOMAIN=domain.com

# Leave blank if there's no subdomain
SUBDOMAIN=subdomain

# TTL (Default 600)
TTL=600

# =============================================================================
# Do not edit below this line
# =============================================================================

# Add slash if using a subdomain
if [[ "${#SUBDOMAIN}" -gt 0 ]] ;then
        SUBDOMAIN="/$SUBDOMAIN"
fi

# URLs
GETURL="https://porkbun.com/api/json/v3/dns/retrieveByNameType/$DOMAIN/A$SUBDOMAIN"
SETURL="https://porkbun.com/api/json/v3/dns/editByNameType/$DOMAIN/A$SUBDOMAIN"

# Data
GETDATA="{ \"apikey\": \"$APIKEY\", \"secretapikey\": \"$APISEC\" }"
SETDATA="{ \"secretapikey\": \"$APISEC\", \"apikey\": \"$APIKEY\", \"ttl\": \"$TTL\""
root@router:~/OpenWRT-DDNS# cat /etc/openwrt_release 
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='23.05-SNAPSHOT'
DISTRIB_REVISION='r23001+721-38c150612c'
DISTRIB_TARGET='mediatek/filogic'
DISTRIB_ARCH='aarch64_cortex-a53'
DISTRIB_DESCRIPTION='OpenWrt 23.05-SNAPSHOT r23001+721-38c150612c'
DISTRIB_TAINTS='busybox'
root@router:~/OpenWRT-DDNS# 

I'm unable to determine exactly what is going wrong. Do you have any suggestions? Thank you.

spuds1 commented 1 month ago

Sorry, I didn't see this until now. Did you get it working?

Is your domain an A record?