fix ip info

This commit is contained in:
wswan 2020-07-18 17:48:39 +08:00
parent 8fe8d20c7d
commit 0461318d80

View File

@ -29,13 +29,9 @@ try {
} }
$res = shell_exec('curl -s https://ifconfig.me'); $realIp = shell_exec('curl -s https://ifconfig.me');
$res = @json_decode($res, true);
if (!empty($res['ip'])) {
$realIp = $res['ip'];
if (!empty($realIp)) {
if ($realIp !== $recordIp) { if ($realIp !== $recordIp) {
$msg = 'ip changed from ' . $recordIp . ' to ' . $realIp; $msg = 'ip changed from ' . $recordIp . ' to ' . $realIp;