From 0f2c5525529626345bcfd89dfe86dd69eb4d616b Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 22 Jun 2011 16:47:32 -0400 Subject: Fix ntop password reset. --- config/ntop2/ntop.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'config') diff --git a/config/ntop2/ntop.xml b/config/ntop2/ntop.xml index 6cd71d60..f0c3ed61 100644 --- a/config/ntop2/ntop.xml +++ b/config/ntop2/ntop.xml @@ -142,12 +142,16 @@ "stop" => "/usr/bin/killall ntop" ) ); - stop_service("ntop"); + if (is_service_running("ntop")) { + stop_service("ntop"); + // Wait for ntop to shut down cleanly. + sleep(20); + } if (empty($ntop_config['password'])) $ntop_config['password'] = "admin"; - sleep(5); unlink_if_exists("/var/db/ntop/ntop_pw.db"); - exec("/usr/local/bin/ntop --set-admin-password={$ntop_config['password']}); + exec("/usr/local/bin/ntop --set-admin-password={$ntop_config['password']}"); + sleep(2); start_service("ntop"); conf_mount_ro(); config_unlock(); -- cgit v1.2.3