diff --git a/README.md b/README.md index 65e0968..78eefea 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,15 @@ Self-hosted dynamic DNS php script to update netcup DNS API from Router like AVM ### AVM FRITZ!Box Settings * Go to "Internet" -> "Freigaben" -> "DynDNS" * Choose "Benutzerdefiniert" -* Update-URL: `https:///update.php?user=&password=&ipv4=&ipv6=&domain=` - * only the url needs to be adjusted, the rest is automatically filled by your AVM FRITZ!Box - * http or https is possible if valid SSL certificate (e.g. Let's Encrypt) +* Single Domain: + * Update-URL: `https:///update.php?user=&password=&ipv4=&ipv6=&domain=` + * only the url needs to be adjusted, the rest is automatically filled by your AVM FRITZ!Box + * http or https is possible if valid SSL certificate (e.g. Let's Encrypt) +* Multiple Domains + * To Update Multiple domains, add every domain as a comma seperated list. + * Update-URL: `https:///update.php?user=&password=&ipv4=&ipv6=&domain=,,....` + * only the url needs to be adjusted, the rest is automatically filled by your AVM FRITZ!Box + * http or https is possible if valid SSL certificate (e.g. Let's Encrypt) * Domainname: `` * Username: `` * Password: `` diff --git a/update.php b/update.php index 24bac06..aab42c2 100755 --- a/update.php +++ b/update.php @@ -17,4 +17,16 @@ if (!file_exists('.env')) { $config = parse_ini_file('.env', false, INI_SCANNER_TYPED); -(new netcup\DNS\API\Handler($config, $_REQUEST))->doRun(); +// Get the domains from the URL parameter and split them from the comma separated string +$domains = explode(',', $_REQUEST['domain']); + +// Loop through each domain and call the Handler +foreach ($domains as $domain) { + // Create a new request object with the current domain + $request = $_REQUEST; + $request['domain'] = trim($domain); + + + // Call the Handler with the current domain + (new netcup\DNS\API\Handler($config, $request))->doRun(); +}