aboutsummaryrefslogtreecommitdiffstats
path: root/packages/nut
diff options
context:
space:
mode:
authorRyan Wagoner <rsw686@pfsense.org>2007-02-19 15:30:29 +0000
committerRyan Wagoner <rsw686@pfsense.org>2007-02-19 15:30:29 +0000
commit8569d929f173745359468e71408aa415f9615290 (patch)
treea697fe3508b2f441907ae58a617676cc6878895b /packages/nut
parent83eebc528950026aabebbe43b68ed25ce06b8ecd (diff)
downloadpfsense-packages-8569d929f173745359468e71408aa415f9615290.tar.gz
pfsense-packages-8569d929f173745359468e71408aa415f9615290.tar.bz2
pfsense-packages-8569d929f173745359468e71408aa415f9615290.zip
-fix status page hanging when nut fails to start
Diffstat (limited to 'packages/nut')
-rw-r--r--packages/nut/status_nut.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/nut/status_nut.php b/packages/nut/status_nut.php
index 14ba84f8..7bbba4c8 100644
--- a/packages/nut/status_nut.php
+++ b/packages/nut/status_nut.php
@@ -129,12 +129,14 @@ include("head.inc");
<td>
<table width="100%" class="tabcont" cellspacing="0" cellpadding="6">
<?php
- if($nut_config['monitor'] == 'local') {
- tblrow('Monitoring:','Local UPS');
- $handle = popen("upsc {$nut_config['name']}@localhost","r");
- } elseif($nut_config['monitor'] == 'remote') {
- tblrow('Monitoring:','Remote UPS');
- $handle = popen("upsc {$nut_config['remotename']}@{$nut_config['remoteaddr']}","r");
+ if((int)exec('pgrep upsmon | wc -l') > 0) {
+ if($nut_config['monitor'] == 'local') {
+ tblrow('Monitoring:','Local UPS');
+ $handle = popen("upsc {$nut_config['name']}@localhost","r");
+ } elseif($nut_config['monitor'] == 'remote') {
+ tblrow('Monitoring:','Remote UPS');
+ $handle = popen("upsc {$nut_config['remotename']}@{$nut_config['remoteaddr']}","r");
+ }
}
if($handle) {