mirror of
https://github.com/AuxXxilium/arc-addons.git
synced 2024-11-23 21:50:52 +07:00
efec6b8454
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
38 lines
800 B
PHP
Executable File
38 lines
800 B
PHP
Executable File
#!/usr/bin/php -d open_basedir=/usr/syno/bin/ddns
|
|
<?php
|
|
|
|
if ($argc !== 5) {
|
|
echo 'badparam';
|
|
exit();
|
|
}
|
|
|
|
$account = (string)$argv[1];
|
|
$pwd = (string)$argv[2];
|
|
$hostname = (string)$argv[3];
|
|
$ip = (string)$argv[4];
|
|
|
|
// Remove .dyn.arcdns.tech if present
|
|
$suffix = '.dyn.arcdns.tech';
|
|
if (substr($hostname, -strlen($suffix)) === $suffix) {
|
|
$hostname = substr($hostname, 0, -strlen($suffix));
|
|
}
|
|
|
|
$url = 'https://arcdns.tech/update/' . $hostname . '/' . $pwd;
|
|
|
|
$req = curl_init();
|
|
curl_setopt($req, CURLOPT_URL, $url);
|
|
curl_setopt($req, CURLOPT_RETURNTRANSFER, true);
|
|
$res = curl_exec($req);
|
|
$json = json_decode($res, true);
|
|
|
|
if ($json['status'] !== 'Successfuly updated') {
|
|
echo 'badauth';
|
|
curl_close($req);
|
|
exit();
|
|
} else {
|
|
echo 'good';
|
|
curl_close($req);
|
|
exit();
|
|
}
|
|
|
|
?>
|