Skip to content

Commit e7cfde1

Browse files
authored
Merge pull request acmesh-official#5049 from hknet/patch-2
fixed handling of key and secret
2 parents 8c07af6 + 39fa40a commit e7cfde1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

dnsapi/dns_kappernet.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
#KAPPERNETDNS_Key="yourKAPPERNETapikey"
88
#KAPPERNETDNS_Secret="yourKAPPERNETapisecret"
9-
10-
KAPPERNETDNS_Api="https://dnspanel.kapper.net/API/1.2?APIKey=$KAPPERNETDNS_Key&APISecret=$KAPPERNETDNS_Secret"
9+
#KAPPERNETDNS_Api="https://dnspanel.kapper.net/API/1.2?APIKey=$KAPPERNETDNS_Key&APISecret=$KAPPERNETDNS_Secret"
1110

1211
###############################################################################
1312
# called with
@@ -19,10 +18,9 @@ dns_kappernet_add() {
1918

2019
KAPPERNETDNS_Key="${KAPPERNETDNS_Key:-$(_readaccountconf_mutable KAPPERNETDNS_Key)}"
2120
KAPPERNETDNS_Secret="${KAPPERNETDNS_Secret:-$(_readaccountconf_mutable KAPPERNETDNS_Secret)}"
21+
KAPPERNETDNS_Api="https://dnspanel.kapper.net/API/1.2?APIKey=$KAPPERNETDNS_Key&APISecret=$KAPPERNETDNS_Secret"
2222

2323
if [ -z "$KAPPERNETDNS_Key" ] || [ -z "$KAPPERNETDNS_Secret" ]; then
24-
KAPPERNETDNS_Key=""
25-
KAPPERNETDNS_Secret=""
2624
_err "Please specify your kapper.net api key and secret."
2725
_err "If you have not received yours - send your mail to"
2826
_err "[email protected] to get your key and secret."
@@ -66,10 +64,9 @@ dns_kappernet_rm() {
6664

6765
KAPPERNETDNS_Key="${KAPPERNETDNS_Key:-$(_readaccountconf_mutable KAPPERNETDNS_Key)}"
6866
KAPPERNETDNS_Secret="${KAPPERNETDNS_Secret:-$(_readaccountconf_mutable KAPPERNETDNS_Secret)}"
67+
KAPPERNETDNS_Api="https://dnspanel.kapper.net/API/1.2?APIKey=$KAPPERNETDNS_Key&APISecret=$KAPPERNETDNS_Secret"
6968

7069
if [ -z "$KAPPERNETDNS_Key" ] || [ -z "$KAPPERNETDNS_Secret" ]; then
71-
KAPPERNETDNS_Key=""
72-
KAPPERNETDNS_Secret=""
7370
_err "Please specify your kapper.net api key and secret."
7471
_err "If you have not received yours - send your mail to"
7572
_err "[email protected] to get your key and secret."
@@ -141,7 +138,7 @@ _kappernet_api() {
141138
if [ "$method" = "GET" ]; then
142139
response="$(_get "$url")"
143140
else
144-
_err "Unsupported method"
141+
_err "Unsupported method or missing Secret/Key"
145142
return 1
146143
fi
147144

0 commit comments

Comments
 (0)