Browse Source
Merge pull request #5048 from hknet/patch-1
dns-record TTL set to 300
pull/3441/merge
neil
9 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
2 deletions
-
dnsapi/dns_kappernet.sh
|
|
@ -41,7 +41,7 @@ dns_kappernet_add() { |
|
|
|
_debug _domain "DOMAIN: $_domain" |
|
|
|
|
|
|
|
_info "Trying to add TXT DNS Record" |
|
|
|
data="%7B%22name%22%3A%22$fullhostname%22%2C%22type%22%3A%22TXT%22%2C%22content%22%3A%22$txtvalue%22%2C%22ttl%22%3A%223600%22%2C%22prio%22%3A%22%22%7D" |
|
|
|
data="%7B%22name%22%3A%22$fullhostname%22%2C%22type%22%3A%22TXT%22%2C%22content%22%3A%22$txtvalue%22%2C%22ttl%22%3A%22300%22%2C%22prio%22%3A%22%22%7D" |
|
|
|
if _kappernet_api GET "action=new&subject=$_domain&data=$data"; then |
|
|
|
|
|
|
|
if _contains "$response" "{\"OK\":true"; then |
|
|
@ -81,7 +81,7 @@ dns_kappernet_rm() { |
|
|
|
_saveaccountconf_mutable KAPPERNETDNS_Secret "$KAPPERNETDNS_Secret" |
|
|
|
|
|
|
|
_info "Trying to remove the TXT Record: $fullhostname containing $txtvalue" |
|
|
|
data="%7B%22name%22%3A%22$fullhostname%22%2C%22type%22%3A%22TXT%22%2C%22content%22%3A%22$txtvalue%22%2C%22ttl%22%3A%223600%22%2C%22prio%22%3A%22%22%7D" |
|
|
|
data="%7B%22name%22%3A%22$fullhostname%22%2C%22type%22%3A%22TXT%22%2C%22content%22%3A%22$txtvalue%22%2C%22ttl%22%3A%22300%22%2C%22prio%22%3A%22%22%7D" |
|
|
|
if _kappernet_api GET "action=del&subject=$fullhostname&data=$data"; then |
|
|
|
if _contains "$response" "{\"OK\":true"; then |
|
|
|
return 0 |
|
|
|