Newer
Older
toolbox / dyndomain-c.sh
Sándor on 23 Feb 2017 1 KB curl check
#!/bin/bash

##
# Dynamic IP update tool for Domains hosted by Sandros HQ
##

##########################
# Settings               #
##########################

# Zone & Record token provided by Sandros HQ <contact: hq@sandros.hu>
zone=""
record=""

# Name details ([sub]domain, IPv6?, value)
dname=""		# example.org: hostname to update
ipv6=""			# &ipv6: AAAA record type
content="detect"	# detect: auto detect IP




###########################
# Pls don't mess w/ this  #
#######################################################################

if [ ${#zone} -le 5 ]; then echo "MISSING: zone"; exit; fi
if [ ${#record} -le 5 ]; then echo "MISSING: record"; exit; fi
if [ ${#dname} -le 5 ]; then echo "MISSING: dname"; exit; fi
if [ ${#content} -le 5 ]; then echo "MISSING: content"; exit; fi

command -v curl >/dev/null 2>&1 || { echo >&2 "I require curl but it's not installed. Aborting."; exit 1; }

curl -X GET "https://toolbox.sandros.hu/dns/cf.php?zone=${zone}&record=${record}&name=${dname}&content=${content}&update${ipv6}"