From 2211b045710c9d0648b3de07f750ccbe5b3f76d4 Mon Sep 17 00:00:00 2001 From: "Danilo G. Baio (dbaio)" Date: Wed, 25 Mar 2015 00:20:50 -0300 Subject: apcupsd - fix tabs --- config/apcupsd/apcupsd_status.php | 52 +++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'config/apcupsd') diff --git a/config/apcupsd/apcupsd_status.php b/config/apcupsd/apcupsd_status.php index 68c0b5aa..dd6a980c 100755 --- a/config/apcupsd/apcupsd_status.php +++ b/config/apcupsd/apcupsd_status.php @@ -107,7 +107,7 @@ pre { Host: "> -
+
Default: localhost
apcaccess uses apcupsd's inbuilt Network Information Server (NIS) to obtain the current status information
@@ -120,46 +120,46 @@ pre { -
- + + = 2.2){ - if($strapcaccess) { + if ($pf_version >= 2.2){ + if($strapcaccess) { echo "Running: apcaccess -h {$strapcaccess}
"; puts("
");
 			putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
-         $ph = popen("apcaccess -h {$strapcaccess} 2>&1", "r" );
-         while ($line = fgets($ph)) echo htmlspecialchars($line);
-         pclose($ph);
-         puts("
"); + $ph = popen("apcaccess -h {$strapcaccess} 2>&1", "r" ); + while ($line = fgets($ph)) echo htmlspecialchars($line); + pclose($ph); + puts(""); }elseif($nis_server){ - $nisip=(check_nis_ip_apcupsd() != ''? check_nis_ip_apcupsd() : "0.0.0.0"); - $nisport=(check_nis_port_apcupsd() != ''? check_nis_port_apcupsd() : "3551"); + $nisip=(check_nis_ip_apcupsd() != ''? check_nis_ip_apcupsd() : "0.0.0.0"); + $nisport=(check_nis_port_apcupsd() != ''? check_nis_port_apcupsd() : "3551"); echo "Running: apcaccess -h {$nisip}:{$nisport}
"; puts("
");
 			putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
-         $ph = popen("apcaccess -h localhost 2>&1", "r" );
+			$ph = popen("apcaccess -h localhost 2>&1", "r" );
 			while ($line = fgets($ph)) echo htmlspecialchars($line);
-         pclose($ph);
-         puts("
"); + pclose($ph); + puts(""); }else - echo "Not running Network Information Server (NIS). In order to run apcaccess on localhost, you need to enable it on APCupsd General settings.
"; + echo "Not running Network Information Server (NIS). In order to run apcaccess on localhost, you need to enable it on APCupsd General settings.
"; }else{ - echo "pfSense version prior to 2.2 runs APCupsd 3.14.10 and apcaccess doesn't accept host parameter.
"; - if ($nis_server){ - puts("
");
-         putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
-         $ph = popen("apcaccess 2>&1", "r" );
-         while ($line = fgets($ph)) echo htmlspecialchars($line);
-         pclose($ph);
-         puts("
"); - }else - echo "Not Network Information Server (NIS). In order to run apcaccess on localhost, you need to enable it on APCupsd General settings.
"; + echo "pfSense version prior to 2.2 runs APCupsd 3.14.10 and apcaccess doesn't accept host parameter.
"; + if ($nis_server){ + puts("
");
+			putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
+			$ph = popen("apcaccess 2>&1", "r" );
+			while ($line = fgets($ph)) echo htmlspecialchars($line);
+			pclose($ph);
+			puts("
"); + }else + echo "Not Network Information Server (NIS). In order to run apcaccess on localhost, you need to enable it on APCupsd General settings.
"; } ?> -- cgit v1.2.3