Commit 8abe1a24 authored by Franco Fichtner's avatar Franco Fichtner

dynamic dns: add oray and 3322, cluster response parsing from same service backend

(cherry picked from commit 12810d94)
(cherry picked from commit bb80ad02)
parent 1e9733ff
......@@ -89,7 +89,14 @@ function dyndns_cron()
function dyndns_list()
{
/*
* XXX something like this would be cool:
*
* https://github.com/openwrt/packages/blob/master/net/ddns-scripts/files/services
*/
return array(
'3322' => '3322',
'citynetwork' => 'City Network',
'cloudflare' => 'CloudFlare',
'custom' => 'Custom',
......@@ -99,23 +106,24 @@ function dyndns_list()
'dnsomatic' => 'DNS-O-Matic',
'duckdns' => 'Duck DNS',
'dyndns' => 'DynDNS (dynamic)',
'dyndns-static' => 'DynDNS (static)',
'dyndns-custom' => 'DynDNS (custom)',
'dyndns-static' => 'DynDNS (static)',
'dyns' => 'DyNS',
'easydns' => 'easyDNS',
'eurodns' => 'EuroDNS',
'freedns' => 'freeDNS',
'gratisdns' => 'GratisDNS',
'googledomains' => 'Google Domains',
'gratisdns' => 'GratisDNS',
'he-net' => 'HE.net',
'he-net-v6' => 'HE.net (v6)',
'he-net-tunnelbroker' => 'HE.net Tunnelbroker',
'he-net-v6' => 'HE.net (v6)',
'loopia' => 'Loopia',
'namecheap' => 'Namecheap',
'noip' => 'No-IP',
'noip-free' => 'No-IP (free)',
'ods' => 'ODS.org',
'opendns' => 'OpenDNS',
'oray' => 'Oray',
'ovh-dynhost' => 'OVH DynHOST',
'route53' => 'Route 53',
'selfhost' => 'SelfHost',
......
......@@ -1556,11 +1556,15 @@ function get_dyndns_ip($int, $ipver = 4)
if ($ipver == 6 || is_private_ip($ip_address)) {
$gateways_status = return_gateways_status(true);
// If the gateway for this interface is down, then the external check cannot work.
// Avoid the long wait for the external check to timeout.
if (stristr($gateways_status[$config['interfaces'][$int]['gateway']]['status'],"down")) {
/*
* If the gateway for this interface is down, then the external
* check cannot work. Avoid the long wait for the external check
* to timeout.
*/
if (stristr($gateways_status[$config['interfaces'][$int]['gateway']]['status'], 'down')) {
return 'down';
}
/* Chinese alternative is http://ip.3322.net/ */
$hosttocheck = $ipver == 6 ? 'http://checkipv6.dyndns.org' : 'http://checkip.dyndns.org';
$ip_ch = curl_init($hosttocheck);
curl_setopt($ip_ch, CURLOPT_RETURNTRANSFER, 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment