diff options
author | doktornotor <notordoktor@gmail.com> | 2015-09-11 08:57:38 +0200 |
---|---|---|
committer | doktornotor <notordoktor@gmail.com> | 2015-09-11 08:57:38 +0200 |
commit | c4cbd93281bebf93e411ba1d21a94260804376e0 (patch) | |
tree | e93cab65f22375e6a8244a73ee1254ade9856656 /config/nut | |
parent | 46ddb5b2270dd1aaa2e56a76ebb363fe3de6b47c (diff) | |
download | pfsense-packages-c4cbd93281bebf93e411ba1d21a94260804376e0.tar.gz pfsense-packages-c4cbd93281bebf93e411ba1d21a94260804376e0.tar.bz2 pfsense-packages-c4cbd93281bebf93e411ba1d21a94260804376e0.zip |
nut - 2.1.x compatible boot check
Another code simplification...
Diffstat (limited to 'config/nut')
-rw-r--r-- | config/nut/nut.inc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/config/nut/nut.inc b/config/nut/nut.inc index 71b06932..a864b965 100644 --- a/config/nut/nut.inc +++ b/config/nut/nut.inc @@ -492,8 +492,7 @@ EOD; } function sync_package_nut() { - global $config; - global $input_errors; + global $g, $config, $input_errors; stop_service("nut"); @@ -509,10 +508,12 @@ EOD; $return = sync_package_nut_snmp(); } - if ((!platform_booting()) && (nut_config('monitor'))) { - /* only start if enabled and system is not booting */ - /* this prevents service from starting / stopping / starting on boot */ - + /* only start if enabled and system is not booting */ + /* this prevents service from starting / stopping / starting on boot */ + if ((function_exists("platform_booting")) && (!platform_booting()) && (nut_config('monitor'))) { + log_error("[nut] INFO: Starting service"); + start_service("nut"); + } elseif ((!($g['booting'])) && (nut_config('monitor'))) { log_error("[nut] INFO: Starting service"); start_service("nut"); } elseif (!$return && file_exists(NUT_RCFILE)) { |