diff options
author | Danilo G. Baio (dbaio) <dbaio@bsd.com.br> | 2015-03-24 23:56:27 -0300 |
---|---|---|
committer | Danilo G. Baio (dbaio) <dbaio@bsd.com.br> | 2015-03-24 23:56:27 -0300 |
commit | 727f60de26c92d93fd18b1f41c4b9775f2a21b9f (patch) | |
tree | 345f36eb8819411ce5f8f378714bdd67e80a3e50 /config/apcupsd/apcupsd.inc | |
parent | 3c555e74abb2833a61bda5525a16a261c5bb5ab4 (diff) | |
download | pfsense-packages-727f60de26c92d93fd18b1f41c4b9775f2a21b9f.tar.gz pfsense-packages-727f60de26c92d93fd18b1f41c4b9775f2a21b9f.tar.bz2 pfsense-packages-727f60de26c92d93fd18b1f41c4b9775f2a21b9f.zip |
apcupsd - add functions
Diffstat (limited to 'config/apcupsd/apcupsd.inc')
-rw-r--r-- | config/apcupsd/apcupsd.inc | 40 |
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); +} + ?> |