praefix ermittelt durch split der domain
This commit is contained in:
parent
8071ca1c55
commit
c560692104
|
|
@ -34,22 +34,27 @@ set -e
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"present")
|
"present")
|
||||||
echo "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"
|
auth_h="Authorization: Bearer $apitoken"
|
||||||
domain_pl="add_record=$2"
|
domain_pl="add_record=$domain"
|
||||||
praefix_pl="praefix="
|
praefix_pl="praefix=$praefix"
|
||||||
type_pl="type=TXT"
|
type_pl="type=TXT"
|
||||||
content_pl="content=$3"
|
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'
|
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")
|
"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"
|
auth_h="Authorization: Bearer $apitoken"
|
||||||
domain_pl="del_record=$2"
|
domain_pl="del_record=$domain"
|
||||||
praefix_pl="praefix="
|
praefix_pl="praefix=$praefix"
|
||||||
type_pl="type=TXT"
|
type_pl="type=TXT"
|
||||||
content_pl="content=$3"
|
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'
|
echo 'curl -s -X DELETE -d "'"$domain_pl"'" -d "'"$praefix_pl"'" -d "'"$type_pl"'" -d "'"$content_pl"'" -H "'"\$auth_h"'" https://ipv64.net/api'
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue