Skip to content

Commit

Permalink
ipsec: fix widget count after 5.5.2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed May 19, 2017
1 parent 0e9b8f1 commit a039ad4
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/www/widgets/widgets/ipsec.widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
$ipsec_detail_array = array();
$ipsec_tunnels = array();
$ipsec_leases = array();
$activetunnels = 0;

if (isset($config['ipsec']['phase1'])) {
$ipsec_leases = json_decode(configd_run("ipsec list leases"), true);
Expand Down Expand Up @@ -67,7 +66,6 @@
}
if (isset($ipsec_tunnels[$child_sa_key])) {
$ipsec_tunnels[$child_sa_key]['active'] = true;
$activetunnels++;
}
}
}
Expand Down Expand Up @@ -111,7 +109,15 @@
</thead>
<tbody>
<tr>
<td><?= $activetunnels; ?></td>
<td>
<?php
$activetunnels = 0;
foreach ($ipsec_tunnels as $ipsec_key => $ipsec) {
$activetunnels += $ipsec['active'] === true;
}
echo $activetunnels;
?>
</td>
<td><?= (count($ipsec_tunnels) - $activetunnels); ?></td>
<td>
<?php
Expand Down

0 comments on commit a039ad4

Please sign in to comment.