~abyxcos/openbsd_scripts

7982816ff27a97fc24b78f61683748f233a4b070 — abyxcos 2 years ago ec875c4 master
And now change our quote soup to a subshell so we can express what is actually going on with the JSON much clearer. Credit ~qbit.
1 files changed, 6 insertions(+), 4 deletions(-)

M dyn_gandi.sh
M dyn_gandi.sh => dyn_gandi.sh +6 -4
@@ 11,13 11,15 @@ case `echo $INET | cut -d ' ' -f 1` in
	'inet6')	CLASS='AAAA'	;;
esac

BODY='{
BODY=`cat <<EOF
{
	"items": [{
		"rrset_type":    "'"$CLASS"'",
		"rrset_type":    "$CLASS",
		"rrset_ttl":     "1200",
		"rrset_values": ["'"$EGRESS_IP"'"]
		"rrset_values": ["$EGRESS_IP"]
	}]
}'
}
EOF`

echo "PUT /v5/livedns/domains/$DOMAIN/records/$SUBDOMAIN HTTP/1.1
User-Agent: OpenBSD nc