From 482f5f96b568335ca94e62549ae5c47bfae6867b Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sun, 13 Mar 2005 22:56:15 +0000 Subject: * Sync package before appending to squid.conf * Change process_kill_command to squid * Remove sed commands that where being used to backup squid.conf since sync_package("squid") will recreate squid.conf --- packages/squidGuard.xml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'packages') diff --git a/packages/squidGuard.xml b/packages/squidGuard.xml index ab4ea972..67abff0e 100644 --- a/packages/squidGuard.xml +++ b/packages/squidGuard.xml @@ -7,9 +7,9 @@ ['installedpackages']['squidGuard']['config'] echo "<pre>"; - sync_package("squid"); $fout = fopen("/usr/local/etc/squid/squidGuard.conf","w"); - fwrite($fout, "# cat squidGuard.conf\n"); + fwrite($fout, "# This configuration was generated by the pfSense package manager.\n"); + fwrite($fout, "# cat squidGuard.conf\n\n"); fwrite($fout, "dbhome /var/db/squidGuard\n"); fwrite($fout, "logdir /usr/local/squid/logs\n"); fwrite($fout, "acl {\n"); @@ -18,6 +18,7 @@ fwrite($fout, "\t }\n"); fwrite($fout, "}\n"); fclose($fout); + sync_package("squid"); $fout = fopen("/usr/local/etc/squid/squid.conf","a"); fwrite($fout, "redirect_program /usr/local/bin/squidGuard -c /usr/local/etc/squid/squidGuard.conf\n"); fwrite($fout, "redirect_children 4\n"); @@ -38,15 +39,10 @@ - mwexec("/usr/bin/sed '\$d' /usr/local/etc/squid/squid.conf > /tmp/squidtmp.conf"); - mwexec("/bin/cp /tmp/squidtmp.conf /usr/local/etc/squid/squid.conf"); - mwexec("/usr/bin/sed '\$d' /usr/local/etc/squid/squid.conf > /tmp/squidtmp.conf"); - mwexec("/bin/cp /tmp/squidtmp.conf /usr/local/etc/squid/squid.conf"); - mwexec("/bin/rm /tmp/squidtmp.conf"); - mwexec("/bin/rm /var/log/squidGuard.lovar/log/squidGuard.log + mwexec("/bin/rm -rf /var/log/squidGuard.lovar/log/squidGuard.log mwexec("/bin/rm -rf /var/db/squidGuard"); sync_package("squid"); system("/usr/local/sbin/squid -k reconfigure"); - squidGuard + squid -- cgit v1.2.3