add schbang
This commit is contained in:
parent
ea953bfe58
commit
2d67869380
1 changed files with 6 additions and 4 deletions
10
dns.sh
10
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"
|
||||
|
|
Loading…
Reference in a new issue