praefix ermittelt durch split der domain

This commit is contained in:
Czechman 2023-01-10 01:47:26 +01:00
parent 8071ca1c55
commit c560692104
1 changed files with 12 additions and 7 deletions

View File

@ -34,22 +34,27 @@ set -e
case "$1" in
"present")
echo "Present"
full_domain=$2
domain=$(echo $full_domain | rev | cut -d . -f -3 | rev)
praefix=${full_domain%"$domain"}
praefix=${praefix%"."}
auth_h="Authorization: Bearer $apitoken"
domain_pl="add_record=$2"
praefix_pl="praefix="
domain_pl="add_record=$domain"
praefix_pl="praefix=$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"
#-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")
full_domain=$2
domain=$(echo $full_domain | rev | cut -d . -f -3 | rev)
praefix=${full_domain%"$domain"}
praefix=${praefix%"."}
auth_h="Authorization: Bearer $apitoken"
domain_pl="del_record=$2"
praefix_pl="praefix="
domain_pl="del_record=$domain"
praefix_pl="praefix=$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"
echo 'curl -s -X DELETE -d "'"$domain_pl"'" -d "'"$praefix_pl"'" -d "'"$type_pl"'" -d "'"$content_pl"'" -H "'"\$auth_h"'" https://ipv64.net/api'
;;
*)