From 026fdf7b9de180f2d92b5796421848e82be6e5f4 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Thu, 10 May 2012 15:42:42 -0300 Subject: imspector-dev - fix report template bugs and missing file --- config/imspector-dev/imspector.inc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'config/imspector-dev/imspector.inc') diff --git a/config/imspector-dev/imspector.inc b/config/imspector-dev/imspector.inc index a4af7771..52c7ae1b 100644 --- a/config/imspector-dev/imspector.inc +++ b/config/imspector-dev/imspector.inc @@ -101,11 +101,12 @@ function deinstall_package_imspector() { imspector_action('stop'); - @unlink(IMSPECTOR_RCFILE); - @unlink(IMSPECTOR_CONFIG); - @unlink(IMSPECTOR_ETC . '/badwords_custom.txt'); - @unlink(IMSPECTOR_ETC . '/acl_blacklist.txt'); - @unlink(IMSPECTOR_ETC . '/acl_whitelist.txt'); + unlink_if_exists(IMSPECTOR_RCFILE); + unlink_if_exists(IMSPECTOR_CONFIG); + unlink_if_exists(IMSPECTOR_ETC . '/badwords_custom.txt'); + unlink_if_exists(IMSPECTOR_ETC . '/acl_blacklist.txt'); + unlink_if_exists(IMSPECTOR_ETC . '/acl_whitelist.txt'); + unlink_if_exists('/usr/local/www/imspector_logs.php'); //exec('pkg_delete imspector-0.4'); } @@ -346,10 +347,11 @@ $template="services_imspector_logs.php"; else $template=$ims_config['template']; - - if (file_exists("/usr/local/www/{$template}")) - $log_file=file_get_contents("/usr/local/www/{$template}"); - file_put_contents("/usr/local/www/imspector_logs.php",$log_file,LOCK_EX); + + /*link template file*/ + $link="/usr/local/www/imspector_logs.php"; + unlink_if_exists($link); + symlink("/usr/local/www/{$template}", $link); /* generate rc file start and stop */ $stop = <<