summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/gwlb.inc8
-rw-r--r--etc/inc/openvpn.inc5
-rwxr-xr-xetc/rc.newwanip14
-rw-r--r--usr/local/www/includes/functions.inc.php12
-rwxr-xr-xusr/local/www/interfaces_assign.php14
-rw-r--r--usr/local/www/javascript/index/ajax.js8
-rw-r--r--usr/local/www/status_openvpn.php4
-rwxr-xr-xusr/local/www/status_rrd_graph.php21
-rw-r--r--usr/local/www/widgets/widgets/gateways.widget.php2
9 files changed, 48 insertions, 40 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index bea0bed..637d9ac 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -243,11 +243,11 @@ EOD;
killbypid("{$g['varrun_path']}/apinger.pid");
if (is_dir("{$g['tmp_path']}"))
chmod("{$g['tmp_path']}", 01777);
- if (!is_dir("{$g['vardb_path']}/rrd")) {
+ if (!is_dir("{$g['vardb_path']}/rrd"))
mkdir("{$g['vardb_path']}/rrd", 0775);
- }
- if (is_dir("{$g['vardb_path']}/rrd"))
- chown("{$g['vardb_path']}/rrd", "nobody");
+
+ @chown("{$g['vardb_path']}/rrd", "nobody");
+
/* start a new apinger process */
mwexec_bg("/usr/local/sbin/apinger -c {$g['varetc_path']}/apinger.conf");
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index 8116f96..ec127b3 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -719,6 +719,7 @@ function openvpn_get_active_servers() {
$server = array();
$server['port'] = $settings['local_port'];
+ $server['mode'] = $settings['mode'];
if ($settings['description'])
$server['name'] = "{$settings['description']} {$prot}:{$port}";
else
@@ -747,7 +748,7 @@ function openvpn_get_active_servers() {
continue;
/* parse end of output line */
- if (strstr($line, "END"))
+ if (strstr($line, "END") || strstr($line, "ERROR"))
break;
/* parse client list line */
@@ -827,7 +828,7 @@ function openvpn_get_active_clients() {
$client['remote_host'] = $list[4];
}
/* parse end of output line */
- if (strstr($line, "END"))
+ if (strstr($line, "END") || strstr($line, "ERROR"))
break;
}
diff --git a/etc/rc.newwanip b/etc/rc.newwanip
index 95d44a3..a6b1bcb 100755
--- a/etc/rc.newwanip
+++ b/etc/rc.newwanip
@@ -74,9 +74,6 @@ if (file_exists("{$g['vardb_path']}/{$interface}_cacheip"))
/* regenerate resolv.conf if DNS overrides are allowed */
system_resolvconf_generate(true);
-/* perform RFC 2136 DNS update */
-services_dnsupdate_process($interface);
-
/* write current WAN IP to file */
file_put_contents("{$g['vardb_path']}/{$interface}_ip", $curwanip);
file_put_contents("{$g['vardb_path']}/{$interface}_cacheip", $curwanip);
@@ -84,6 +81,9 @@ file_put_contents("{$g['vardb_path']}/{$interface}_cacheip", $curwanip);
if (is_ipaddr($oldip) && $curwanip == $oldip)
exit;
+/* perform RFC 2136 DNS update */
+services_dnsupdate_process($interface);
+
/* signal dyndns update */
file_put_contents("{$g['tmp_path']}/update_dyndns", $interface);
@@ -100,16 +100,14 @@ filter_configure();
/* reload graphing functions */
enable_rrd_graphing();
-/* update the gateway group items gateway */
-//update_gateway_groups_defaultroute($interface);
+/* reconfigure our gateway monitor */
+setup_gateways_monitor();
+
/* restart packages */
mwexec_bg("/usr/local/sbin/ntpdate_sync_once.sh");
mwexec_bg("/etc/rc.start_packages");
log_error("{$g['product_name']} package system has detected an ip change $oldip -> $curwanip ... Restarting packages.");
-/* reconfigure our gateway monitor */
-setup_gateways_monitor();
-
return 0;
?>
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php
index 9bb9ea2..677c2fd 100644
--- a/usr/local/www/includes/functions.inc.php
+++ b/usr/local/www/includes/functions.inc.php
@@ -33,23 +33,23 @@ function get_gatewaystats() {
$data .= ",";
$isfirst = false;
$data .= $gw['name'] . ",";
- $data .= $gw['gateway'] . ",";
+ $data .= lookup_gateway_ip_by_name($gw['name']) . ",";
$data .= $gw['delay'] . ",";
$data .= $gw['loss'] . ",";
- switch($gw['status']) {
- case "None":
+ switch(strtolower($gw['status'])) {
+ case "none":
$online = "Online";
$bgcolor = "lightgreen";
break;
- case "\"down\"":
+ case "down":
$online = "Offline";
$bgcolor = "lightcoral";
break;
- case "\"delay\"":
+ case "delay":
$online = "Warning, Latency";
$bgcolor = "khaki";
break;
- case "\"loss\"":
+ case "loss":
$online = "Warning, Packetloss";
$bgcolor = "khaki";
break;
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index 0ab536a..421286c 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -421,7 +421,7 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
<tr>
<td class="listlr" valign="middle"><strong><?=$ifdescr;?></strong></td>
<td valign="middle" class="listr">
- <select onChange="javascript:\$('savediv').appear();" name="<?=$ifname;?>" id="<?=$ifname;?>">
+ <select onChange="javascript:$('savediv').appear();" name="<?=$ifname;?>" id="<?=$ifname;?>">
<?php foreach ($portlist as $portname => $portinfo): ?>
<option value="<?=$portname;?>" <?php if ($portname == $iface['if']) echo " selected";?>>
<?php if ($portinfo['isvlan']) {
@@ -486,18 +486,16 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
</table>
</div>
<br/>
-<div name='savediv' id='savediv' style='display:none;'>
+<div name='savediv' id='savediv' <?php if (empty($_GET['act'])) echo "style='display:none;'"; ?>>
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"><br><br>
<p>
</div>
</p>
<ul>
- <li><span class="vexpl"><?=gettext("change the IP address of your computer"); ?></span></li>
- <li><span class="vexpl"><?=gettext("renew its DHCP lease"); ?></span></li>
- <li><span class="vexpl"><?=gettext("access the webConfigurator with the new IP address"); ?></span></li>
- <li><span class="vexpl"><?=gettext("interfaces that are configured as members of a lagg(4) interface will not be shown."); ?></span></li>
-</ul></td>
- </tr>
+ <li><span class="vexpl"><?=gettext("Interfaces that are configured as members of a lagg(4) interface will not be shown."); ?></span></li>
+</ul>
+</td>
+</tr>
</table>
</form>
<?php include("fend.inc"); ?>
diff --git a/usr/local/www/javascript/index/ajax.js b/usr/local/www/javascript/index/ajax.js
index 5eaa8c5..3259955 100644
--- a/usr/local/www/javascript/index/ajax.js
+++ b/usr/local/www/javascript/index/ajax.js
@@ -56,10 +56,10 @@ function updateCPU(x) {
$("cpuwidtha").style.width = x + 'px';
if($('cpuwidthb'))
$("cpuwidthb").style.width = (100 - x) + 'px';
- /* Load CPU Graph widget if enabled */
- if(typeof GraphValue == 'function') {
- GraphValue(graph[0], x);
- }
+ /* Load CPU Graph widget if enabled */
+ if(widgetActive('cpu_graphs')) {
+ GraphValue(graph[0], x);
+ }
}
function updateTemp(x) {
diff --git a/usr/local/www/status_openvpn.php b/usr/local/www/status_openvpn.php
index 4e0c520..729ed70 100644
--- a/usr/local/www/status_openvpn.php
+++ b/usr/local/www/status_openvpn.php
@@ -136,6 +136,9 @@ include("head.inc"); ?>
</td>
</tr>
<tr>
+<?php if ($server['mode'] == "p2p_shared_key"): ?>
+ <td>Status data is not available for shared key servers.</td>
+<?php else: ?>
<td>
<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
@@ -182,6 +185,7 @@ include("head.inc"); ?>
</table>
</td>
+<? endif; ?>
</tr>
</table>
diff --git a/usr/local/www/status_rrd_graph.php b/usr/local/www/status_rrd_graph.php
index 28e6220..14dc30d 100755
--- a/usr/local/www/status_rrd_graph.php
+++ b/usr/local/www/status_rrd_graph.php
@@ -227,11 +227,13 @@ function get_dates($curperiod, $graph) {
break;
}
$start = mktime((8 + $houroffset), 0, 0, $curmonth, $curday, $curyear);
- $end = mktime((8 + $houroffset) + 12, 0, 0, $curmonth, $curday, $curyear);
+ if($offset == 0)
+ $end = mktime((8 + $houroffset) + 12, 0, 0, $curmonth, $curday, $curyear);
break;
case "day":
$start = mktime(0, 0, 0, $curmonth, ($curday + $offset), $curyear);
- $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear);
+ if($offset == 0)
+ $end = mktime(0, 0, 0, $curmonth, (($curday + $offset) + 1), $curyear);
break;
case "week":
switch($offset) {
@@ -243,23 +245,28 @@ function get_dates($curperiod, $graph) {
break;
}
$start = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset), $curyear);
- $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear);
+ if($offset == 0)
+ $end = mktime(0, 0, 0, $curmonth, (($curday - $curweekday) + $weekoffset + 7), $curyear);
break;
case "month":
$start = mktime(0, 0, 0, ($curmonth + $offset), 0, $curyear);
- $end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
+ if($offset == 0)
+ $end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
break;
case "quarter":
$start = mktime(0, 0, 0, (($curmonth - 2) + $offset), 0, $curyear);
- $end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
+ if($offset == 0)
+ $end = mktime(0, 0, 0, (($curmonth + $offset) + 1), 0, $curyear);
break;
case "year":
$start = mktime(0, 0, 0, 1, 0, ($curyear + $offset));
- $end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
+ if($offset == 0)
+ $end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
break;
case "4year":
$start = mktime(0, 0, 0, 1, 0, (($curyear - 3) + $offset));
- $end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
+ if($offset == 0)
+ $end = mktime(0, 0, 0, 1, 0, (($curyear + $offset) +1));
break;
}
// echo "start $start ". date('l jS \of F Y h:i:s A', $start) .", end $end ". date('l jS \of F Y h:i:s A', $end) ."<br>";
diff --git a/usr/local/www/widgets/widgets/gateways.widget.php b/usr/local/www/widgets/widgets/gateways.widget.php
index a744d5b..07b2397 100644
--- a/usr/local/www/widgets/widgets/gateways.widget.php
+++ b/usr/local/www/widgets/widgets/gateways.widget.php
@@ -68,7 +68,7 @@ $counter = 1;
<?=$gateway['loss'];?>
<?php $counter++; ?>
</td>
- <td class="listr" id=\"gateway<?=$counter?>\" >
+ <td class="listr" id="gateway<?=$counter?>" >
<table border="0" cellpadding="0" cellspacing="2">
<?php
if (stristr($gateway['status'], "down")) {
OpenPOWER on IntegriCloud