Removed unnecessory data
parent
0d1e4d570a
commit
72efca13a8
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
export DOMAIN=scipttestingengine.tk
|
|
||||||
export CLOUDFLARE_TOKEN=r-N2jYMC1cP9bDjudvsaILqdKoRh0xN62idZeXaT
|
|
||||||
export HETZNER_TOKEN=TY4MkkbyIJDhtRIDRj0arU6OSzn5z4x7rvQpoiNsWLFMSuROQr7IFz8OsLQmh4JH
|
|
||||||
|
|
||||||
curl -s -X GET "https://api.cloudflare.com/client/v4/zones" -H "Authorization: Bearer $CLOUDFLARE_TOKEN" -H "Content-Type: application/json" > .cloudflare_zones.json
|
|
||||||
|
|
||||||
|
|
||||||
export zoneid=$( for i in {0..24}; do jq 'if .result['$i'].name == "'$DOMAIN'" then .result['$i'].id else null end' .cloudflare_zones.json; done | grep -v null | sed -e 's/^"//' -e 's/"$//' )
|
|
||||||
curl -X GET "https://api.cloudflare.com/client/v4/zones/$zoneid/dns_records" -H "Authorization: Bearer $CLOUDFLARE_EMAIL" -H "Content-Type: application/json" > .cloudflare_records.json
|
|
||||||
|
|
||||||
for i in `seq 0 4`
|
|
||||||
do
|
|
||||||
export recordid=$(jq '.result['$i'].id' .cloudflare_records.json | sed -e 's/^"//' -e 's/"$//')
|
|
||||||
curl -X DELETE "https://api.cloudflare.com/client/v4/zones/$zoneid/dns_records/$recordid" -H "Authorization: Bearer $CLOUDFLARE_TOKEN" -H "Content-Type: application/json"
|
|
||||||
done
|
|
||||||
|
|
||||||
curl \
|
|
||||||
-H "Authorization: Bearer $HETZNER_TOKEN" \
|
|
||||||
'https://api.hetzner.cloud/v1/servers' > .hetzner_machines.json
|
|
||||||
|
|
||||||
export machineid=$( for i in {0..24}; do jq 'if .servers['$i'].name == "nixos-mailserver" then .servers['$i'].id else null end' )
|
|
||||||
|
|
||||||
curl \
|
|
||||||
-X DELETE \
|
|
||||||
-H "Authorization: Bearer $HETZNER_TOKEN" \
|
|
||||||
'https://api.hetzner.cloud/v1/servers/$machineid'
|
|
||||||
|
|
||||||
bash <(curl -s https://selfprivacy.org/server.sh)
|
|
Loading…
Reference in New Issue