Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions components/os.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ function __construct() {
/* --------------------------------------------------------------
* Get real remote ip
* -------------------------------------------------------------- */
$ip = @file_get_contents('http://checkip.dyndns.org');
$ip = simplexml_load_string(@file_get_contents('http://geoip.ubuntu.com/lookup'));

if ($ip) {
preg_match('/Current IP Address: ([0-9a-f:\.]+)/', $ip, $matches);
$this->ip = $matches[1];

if ($ip && $ip->Ip) {
$this->ip = $ip->Ip;
}
}

Expand Down
3 changes: 3 additions & 0 deletions widgets/60-network.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

<?php if(isset($adapter->ip)): ?>
<small <?php echo $adapter->state == "up" ? 'class="green"' : ''; ?>><?php echo $adapter->ip; ?></small>
<?php if(isset($system->os->ip)):?>
<small class="green"><?php echo $system->os->ip; ?></small>
<?php endif; ?>
<?php endif; ?>

</div>
Expand Down