Skip to content

Commit

Permalink
Create addDomainRecord.php
Browse files Browse the repository at this point in the history
  • Loading branch information
z9877969 authored Apr 1, 2024
1 parent ff743d3 commit 8c6202d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions scripts/addDomainRecord.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

$auth_token = $argv[3];
$post = [
'domain_id' => $argv[4],
'type' => 'A',
'data' => $argv[2],
'priority' => 0,
'record' => $argv[1],
];


// Додавання dns записів домену
// Отправляем запрос на сервер
$ch = curl_init("https://adm.tools/action/dns/record_add/");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer '.$auth_token],
CURLOPT_POSTFIELDS => http_build_query($post),
CURLOPT_VERBOSE => true
]);
$json = curl_exec($ch);
$response = @json_decode($json, true);

var_dump($response);

0 comments on commit 8c6202d

Please sign in to comment.