summaryrefslogtreecommitdiffstats
path: root/proxy_wizard/scripts/Squidconf.pm
diff options
context:
space:
mode:
Diffstat (limited to 'proxy_wizard/scripts/Squidconf.pm')
-rw-r--r--proxy_wizard/scripts/Squidconf.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/proxy_wizard/scripts/Squidconf.pm b/proxy_wizard/scripts/Squidconf.pm
new file mode 100644
index 00000000..877d60d5
--- /dev/null
+++ b/proxy_wizard/scripts/Squidconf.pm
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+package Squidconf;
+require "__WIZ_HOME__/common/scripts/Vareqval.pm";
+require "__WIZ_HOME__/common/scripts/Varspaceval.pm";
+use MDK::Common;
+use strict;
+
+sub do_it_squid {
+ my %mdk = Vareqval->get("/etc/sysconfig/mdk_serv");
+ $mdk{wiz_squid_defdir} = $ENV{wiz_squid_defdir};
+ $mdk{wiz_squid_level} = $ENV{wiz_squid_level};
+ Vareqval->commit("/etc/sysconfig/mdk_serv");
+ my $file="/etc/squid/squid.conf";
+ MDK::Common::cp_af($file, $file.".orig");
+ MDK::Common::cp_af("__WIZ_HOME__/proxy_wizard/scripts/squid.conf.default", $file);
+ %mdk = Varspaceval->get($file);
+# echo_debug "squid port ${wiz_squid_port}"
+ $mdk{http_port} = $ENV{wiz_squid_port};
+# echo_debug "squid mem ${wiz_squid_mem}"
+ $mdk{cache_mem} = "$ENV{wiz_squid_mem} MB";
+ my %mdk = Varspaceval->commit($file, \%mdk);
+# echo_debug "squid disk ${wiz_squid_disk}"
+ $t = `grep -E "^[[:space:]]*cache_dir[[:space:]]+[a-z]+[[:space:]]+$ENV{wiz_squid_defdir}[[:space:]]+[0-9]+" $file`;
+
+}