From 8071ca1c55663808fb57b7b57f970948a0a4839e Mon Sep 17 00:00:00 2001 From: Czechman Date: Tue, 10 Jan 2023 00:33:20 +0100 Subject: [PATCH] =?UTF-8?q?api=20aufruf=20in=20curl=20angepasst=20und=20f?= =?UTF-8?q?=C3=BCr=20test=20nur=20echo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ipv64-dns-challenge.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/ipv64-dns-challenge.sh b/ipv64-dns-challenge.sh index b4ad589..c729e79 100755 --- a/ipv64-dns-challenge.sh +++ b/ipv64-dns-challenge.sh @@ -34,19 +34,23 @@ set -e case "$1" in "present") echo "Present" - authorization="Authorization: Bearer $apitoken" - payload="{\"add_record\":\"$2\",, \"type\":\"TXT\", \"content\":\"$3\"}" - echo "payload=${payload}" + auth_h="Authorization: Bearer $apitoken" + domain_pl="add_record=$2" + praefix_pl="praefix=" + type_pl="type=TXT" + content_pl="content=$3" #curl -X POST https://ipv64.net/api.php -H "$authorization" -d "add_record=czechman.ipv64.de" -d "type=TXT" -d "content=test" - curl -s -X POST -d "${payload}" -H "$authorization" https://ipv64.net/api +#-d "del_record=czechman.ipv64.de" -d "praefix=_acme" -d "type=TXT" -d "content=drei" -H "Authorization: Bearer yS3de7wD2EJHtUAxivRW8lkufcg6Y0pq" + echo 'curl -s -X POST -d "'"$domain_pl"'" -d "'"$praefix_pl"'" -d "'"$type_pl"'" -d "'"$content_pl"'" -H "'"\$auth_h"'" https://ipv64.net/api' ;; "cleanup") - echo "cleanup" - authorization="Authorization: Bearer $apitoken" - payload="{\"del_record\":\"$2\",, \"type\":\"TXT\", \"content\":\"$3\"}" - echo "payload=${payload}" + auth_h="Authorization: Bearer $apitoken" + domain_pl="del_record=$2" + praefix_pl="praefix=" + type_pl="type=TXT" + content_pl="content=$3" #curl -X POST https://ipv64.net/api.php -H "$authorization" -d "add_record=czechman.ipv64.de" -d "type=TXT" -d "content=test" - curl -s -X DELETE -d "${payload}" -H "$authorization" https://ipv64.net/api + echo 'curl -s -X DELETE -d "'"$domain_pl"'" -d "'"$praefix_pl"'" -d "'"$type_pl"'" -d "'"$content_pl"'" -H "'"\$auth_h"'" https://ipv64.net/api' ;; *) echo "OOPS"