diff options
author | doktornotor <notordoktor@gmail.com> | 2015-11-06 22:01:23 +0100 |
---|---|---|
committer | doktornotor <notordoktor@gmail.com> | 2015-11-06 22:01:23 +0100 |
commit | 94f80a8d1990d7ed23f63e07fe8178351bc1cb63 (patch) | |
tree | 1755c76db502e788bc050686e2d84d19293300f9 /config/ntopng | |
parent | 2d44eb0225d84775fe3dc9ba4c500386aac79ba7 (diff) | |
download | pfsense-packages-94f80a8d1990d7ed23f63e07fe8178351bc1cb63.tar.gz pfsense-packages-94f80a8d1990d7ed23f63e07fe8178351bc1cb63.tar.bz2 pfsense-packages-94f80a8d1990d7ed23f63e07fe8178351bc1cb63.zip |
ntopng - unlink rc script when disabled to prevent it from starting on reboot
Diffstat (limited to 'config/ntopng')
-rw-r--r-- | config/ntopng/ntopng.inc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/config/ntopng/ntopng.inc b/config/ntopng/ntopng.inc index 73db1ab0..92b0c5dd 100644 --- a/config/ntopng/ntopng.inc +++ b/config/ntopng/ntopng.inc @@ -94,6 +94,14 @@ function ntopng_sync_package() { $ifaces = ""; $ntopng_config =& $config['installedpackages']['ntopng']['config'][0]; + + /* Just stop services and unlink rc script if disabled */ + if ($ntopng_config['enable'] != "on") { + ntopng_services_stop(); + unlink_if_exists("/usr/local/etc/rc.d/ntopng.sh"); + return; + } + foreach ($ntopng_config['interface_array'] as $iface) { $if = convert_friendly_interface_to_real_interface_name($iface); if ($if) { @@ -168,19 +176,15 @@ function ntopng_sync_package() { /* Set up admin password */ ntopng_set_redis_password(); - /* Restart services if enabled and not booting */ + /* (Re)start services if not booting */ if ((function_exists("platform_booting")) && (!platform_booting())) { ntopng_services_stop(); - if ($ntopng_config['enable'] == "on") { - start_service("ntopng"); - sleep(20); - } + start_service("ntopng"); + sleep(20); } elseif (!($g['booting'])) { ntopng_services_stop(); - if ($ntopng_config['enable'] == "on") { - start_service("ntopng"); - sleep(20); - } + start_service("ntopng"); + sleep(20); } } |