diff options
author | Renato Botelho <renato@netgate.com> | 2015-08-11 11:51:49 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-08-11 11:51:49 -0300 |
commit | c0ab8887bdfff3064351e598840bdce35a174fbd (patch) | |
tree | 1c10c40b313e557e460668cb09876405cd2759eb /config/nut | |
parent | cc096698792f9d4967521ccd7254a5659a54c747 (diff) | |
parent | 3ee968c508b4cfe0b131e5df4c4321d5de69bc27 (diff) | |
download | pfsense-packages-c0ab8887bdfff3064351e598840bdce35a174fbd.tar.gz pfsense-packages-c0ab8887bdfff3064351e598840bdce35a174fbd.tar.bz2 pfsense-packages-c0ab8887bdfff3064351e598840bdce35a174fbd.zip |
Merge pull request #990 from doktornotor/patch-7
Diffstat (limited to 'config/nut')
-rw-r--r-- | config/nut/nut.inc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/config/nut/nut.inc b/config/nut/nut.inc index fbc75a30..e0ca9d30 100644 --- a/config/nut/nut.inc +++ b/config/nut/nut.inc @@ -512,13 +512,13 @@ EOD; $return = sync_package_nut_snmp(); } - if ($return && $_POST['monitor']) { - /* only start if changing settings as we have a startup script for system boot */ + if ((!platform_booting()) && (nut_config('monitor'))) { + /* only start if enabled and system is not booting */ /* this prevents service from starting / stopping / starting on boot */ log_error("[nut] INFO: Starting service"); start_service("nut"); - if ((int)exec('/bin/pgrep upsmon | /usr/bin/wc -l') == 0) { + if (!is_process_running('upsmon')) { log_error("[nut] ERROR: Service failed to start: check configuration."); } } elseif (!$return && file_exists(NUT_RCFILE)) { |