From 9bea15deb098e44d59674836fbb18d095ac3f837 Mon Sep 17 00:00:00 2001 From: bkw Date: Tue, 15 Mar 2005 23:06:01 +0000 Subject: dir creation, permissions, user/groups add,remove --- packages/squid.xml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'packages') diff --git a/packages/squid.xml b/packages/squid.xml index bcb20981..1f06580c 100644 --- a/packages/squid.xml +++ b/packages/squid.xml @@ -8,8 +8,9 @@ echo "<pre>"; system("/bin/mkdir /usr/local/etc/squid"); - system("/usr/bin/touch /usr/local/etc/squid/mime.conf"); - $lancfg = $config['interfaces']['lan']; + system("/usr/sbin/pw adduser squid -s /bin/false"); + system("/usr/sbin/pw addgroup squid"); + $lancfg = $config['interfaces']['lan']; $lanif = $lancfg['if']; $lanip = $lancfg['ipaddr']; $lansa = gen_subnet($lancfg['ipaddr'], $lancfg['subnet']); @@ -38,13 +39,20 @@ fwrite($fout, "httpd_accel_uses_host_header on\n"); fwrite($fout, "cache_effective_user squid\n"); fwrite($fout, "cache_effective_group squid\n"); - fclose($fout); + fclose($fout); $fout = fopen("/usr/local/etc/rc.d/squid.sh","w"); fwrite($fout, "#!/bin/sh\n"); fwrite($fout, "/usr/local/sbin/squid\n\n"); fclose($fout); system("chmod a+x /usr/local/etc/rc.d/squid.sh"); - system("/usr/local/sbin/squid -z"); + system("/usr/bin/touch /usr/local/etc/squid/mime.conf"); + system("/bin/mkdir /usr/local/squid"); + system("/bin/mkdir /usr/local/squid/cache"); + system("/bin/mkdir /usr/local/libexec/squid"); + system("chown -R squid:squid /usr/local/squid"); + system("chown -R squid:squid /usr/local/etc/squid"); + system("chown -R squid:squid /usr/local/libexec/squid"); + system("/usr/local/sbin/squid -z"); system("/usr/local/sbin/squid"); filter_configure(); @@ -57,7 +65,9 @@ exec("rm -rf /usr/local/squid/"); exec("rm -rf /usr/local/etc/squid/"); exec("rm -rf /usr/local/libexec/squid/"); + exec("/usr/sbin/pw deluser squid"); + exec("/usr/sbin/pw delgroup squid"); /usr/local/sbin/squid squid - \ No newline at end of file + -- cgit v1.2.3