summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdns.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/dns.sh b/dns.sh
index 210ff7f..3ff8c0d 100755
--- a/dns.sh
+++ b/dns.sh
@@ -1,3 +1,5 @@
+#!/usr/bin/env sh
+
API_TOKEN="${API_TOKEN:-ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcd}"
ZONE="${ZONE:-example.com}"
DOMAIN="${DOMAIN:-example.com}"
@@ -41,7 +43,7 @@ GET() {
CURL "GET" "$1" ""
}
-EVENT "Getting Zones"
+EVENT "Getting zones"
ZONES=$(GET "/zones")
ZONE_ID="null"
@@ -57,7 +59,7 @@ while true; do
NAME=$(echo $ZONE_JSON | jq -r ".name")
ID=$(echo $ZONE_JSON | jq -r ".id")
- LOG "Found Zone $NAME ($ID)"
+ LOG "Found zone $NAME ($ID)"
if [ "$NAME" == "$ZONE" ]; then
ZONE_ID=$ID
@@ -73,7 +75,7 @@ if [ "$ZONE_ID" == "null" ]; then
exit 1
fi
-EVENT "Getting Records"
+EVENT "Getting records"
RECORDS=$(GET "/zones/$ZONE_ID/dns_records")
@@ -142,7 +144,7 @@ IPv6JSON="{
\"type\": \"AAAA\"
}"
-EVENT "Updating Records"
+EVENT "Updating records"
if [ "$IPv4Id" == "null" ]; then
LOG "No IPv4 record found... creating new one"