Update networktool.php
This commit is contained in:
parent
c4754c2589
commit
7c1f6c4303
|
|
@ -106,6 +106,7 @@ if(!function_exists("get_os_platform")) {
|
||||||
if(!function_exists("get_network_outbound_addr")) {
|
if(!function_exists("get_network_outbound_addr")) {
|
||||||
function get_network_outbound_addr($protocol="") {
|
function get_network_outbound_addr($protocol="") {
|
||||||
$addr = false;
|
$addr = false;
|
||||||
|
$config = get_config();
|
||||||
|
|
||||||
// via icanhazip.com
|
// via icanhazip.com
|
||||||
if(loadHelper("webpagetool")) {
|
if(loadHelper("webpagetool")) {
|
||||||
|
|
@ -117,7 +118,13 @@ if(!function_exists("get_network_outbound_addr")) {
|
||||||
// via opendns.com
|
// via opendns.com
|
||||||
if(!$addr && loadHelper("exectool")) {
|
if(!$addr && loadHelper("exectool")) {
|
||||||
$cmd = "dig +short myip.opendns.com @resolver1.opendns.com";
|
$cmd = "dig +short myip.opendns.com @resolver1.opendns.com";
|
||||||
$addr = exec_command($cmd, "shell_exec");
|
$fw = write_stroage_file(exec_command($cmd, "shell_exec"), array(
|
||||||
|
"storage_type" => "cache",
|
||||||
|
"filename" => get_hashed_text($cmd, array("salt" => true))
|
||||||
|
));
|
||||||
|
$addr = read_storage_file($fw, array(
|
||||||
|
"storage_type" => "cache"
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $addr;
|
return $addr;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user