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() ...@@ -89,7 +89,14 @@ function dyndns_cron()
function dyndns_list() function dyndns_list()
{ {
/*
* XXX something like this would be cool:
*
* https://github.com/openwrt/packages/blob/master/net/ddns-scripts/files/services
*/
return array( return array(
'3322' => '3322',
'citynetwork' => 'City Network', 'citynetwork' => 'City Network',
'cloudflare' => 'CloudFlare', 'cloudflare' => 'CloudFlare',
'custom' => 'Custom', 'custom' => 'Custom',
...@@ -99,23 +106,24 @@ function dyndns_list() ...@@ -99,23 +106,24 @@ function dyndns_list()
'dnsomatic' => 'DNS-O-Matic', 'dnsomatic' => 'DNS-O-Matic',
'duckdns' => 'Duck DNS', 'duckdns' => 'Duck DNS',
'dyndns' => 'DynDNS (dynamic)', 'dyndns' => 'DynDNS (dynamic)',
'dyndns-static' => 'DynDNS (static)',
'dyndns-custom' => 'DynDNS (custom)', 'dyndns-custom' => 'DynDNS (custom)',
'dyndns-static' => 'DynDNS (static)',
'dyns' => 'DyNS', 'dyns' => 'DyNS',
'easydns' => 'easyDNS', 'easydns' => 'easyDNS',
'eurodns' => 'EuroDNS', 'eurodns' => 'EuroDNS',
'freedns' => 'freeDNS', 'freedns' => 'freeDNS',
'gratisdns' => 'GratisDNS',
'googledomains' => 'Google Domains', 'googledomains' => 'Google Domains',
'gratisdns' => 'GratisDNS',
'he-net' => 'HE.net', 'he-net' => 'HE.net',
'he-net-v6' => 'HE.net (v6)',
'he-net-tunnelbroker' => 'HE.net Tunnelbroker', 'he-net-tunnelbroker' => 'HE.net Tunnelbroker',
'he-net-v6' => 'HE.net (v6)',
'loopia' => 'Loopia', 'loopia' => 'Loopia',
'namecheap' => 'Namecheap', 'namecheap' => 'Namecheap',
'noip' => 'No-IP', 'noip' => 'No-IP',
'noip-free' => 'No-IP (free)', 'noip-free' => 'No-IP (free)',
'ods' => 'ODS.org', 'ods' => 'ODS.org',
'opendns' => 'OpenDNS', 'opendns' => 'OpenDNS',
'oray' => 'Oray',
'ovh-dynhost' => 'OVH DynHOST', 'ovh-dynhost' => 'OVH DynHOST',
'route53' => 'Route 53', 'route53' => 'Route 53',
'selfhost' => 'SelfHost', 'selfhost' => 'SelfHost',
......
...@@ -1556,11 +1556,15 @@ function get_dyndns_ip($int, $ipver = 4) ...@@ -1556,11 +1556,15 @@ function get_dyndns_ip($int, $ipver = 4)
if ($ipver == 6 || is_private_ip($ip_address)) { if ($ipver == 6 || is_private_ip($ip_address)) {
$gateways_status = return_gateways_status(true); $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 the gateway for this interface is down, then the external
if (stristr($gateways_status[$config['interfaces'][$int]['gateway']]['status'],"down")) { * 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'; return 'down';
} }
/* Chinese alternative is http://ip.3322.net/ */
$hosttocheck = $ipver == 6 ? 'http://checkipv6.dyndns.org' : 'http://checkip.dyndns.org'; $hosttocheck = $ipver == 6 ? 'http://checkipv6.dyndns.org' : 'http://checkip.dyndns.org';
$ip_ch = curl_init($hosttocheck); $ip_ch = curl_init($hosttocheck);
curl_setopt($ip_ch, CURLOPT_RETURNTRANSFER, 1); 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