arcdns: add sanity check

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-09-07 15:42:14 +02:00
parent c5e9768f05
commit efec6b8454

View File

@ -11,10 +11,10 @@ $pwd = (string)$argv[2];
$hostname = (string)$argv[3];
$ip = (string)$argv[4];
// check the hostname contains '.'
if (strpos($hostname, '.') === true) {
echo 'badparam';
exit();
// 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;