aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo G. Baio (dbaio) <dbaio@bsd.com.br>2015-03-24 23:56:27 -0300
committerDanilo G. Baio (dbaio) <dbaio@bsd.com.br>2015-03-24 23:56:27 -0300
commit727f60de26c92d93fd18b1f41c4b9775f2a21b9f (patch)
tree345f36eb8819411ce5f8f378714bdd67e80a3e50
parent3c555e74abb2833a61bda5525a16a261c5bb5ab4 (diff)
downloadpfsense-packages-727f60de26c92d93fd18b1f41c4b9775f2a21b9f.tar.gz
pfsense-packages-727f60de26c92d93fd18b1f41c4b9775f2a21b9f.tar.bz2
pfsense-packages-727f60de26c92d93fd18b1f41c4b9775f2a21b9f.zip
apcupsd - add functions
-rw-r--r--config/apcupsd/apcupsd.inc40
1 files changed, 40 insertions, 0 deletions
diff --git a/config/apcupsd/apcupsd.inc b/config/apcupsd/apcupsd.inc
index c123861c..9ebb263b 100644
--- a/config/apcupsd/apcupsd.inc
+++ b/config/apcupsd/apcupsd.inc
@@ -224,5 +224,45 @@ EOF;
}
+function check_nis_running_apcupsd(){
+ global $config, $g;
+
+ if (is_array($config['installedpackages']['apcupsd'])){
+ $apcupsd_config = $config['installedpackages']['apcupsd']['config'][0];
+
+ if ($apcupsd_config['apcupsdenabled']=="on" && $apcupsd_config['netserver']=="on" )
+ return(true);
+ }
+
+ return(false);
+}
+
+
+function check_nis_ip_apcupsd(){
+ global $config, $g;
+
+ if (is_array($config['installedpackages']['apcupsd'])){
+ $apcupsd_config = $config['installedpackages']['apcupsd']['config'][0];
+
+ if ($apcupsd_config['apcupsdenabled']=="on" && $apcupsd_config['netserver']=="on" )
+ return($apcupsd_config['nisip']);
+ }
+
+ return(false);
+}
+
+function check_nis_port_apcupsd(){
+ global $config, $g;
+
+ if (is_array($config['installedpackages']['apcupsd'])){
+ $apcupsd_config = $config['installedpackages']['apcupsd']['config'][0];
+
+ if ($apcupsd_config['apcupsdenabled']=="on" && $apcupsd_config['netserver']=="on" )
+ return($apcupsd_config['nisport']);
+ }
+
+ return(false);
+}
+
?>