summaryrefslogtreecommitdiffstats
path: root/proxy_wizard
diff options
context:
space:
mode:
authorArnaud Desmons <adesmons@mandriva.com>2002-07-26 09:21:20 +0000
committerArnaud Desmons <adesmons@mandriva.com>2002-07-26 09:21:20 +0000
commit8713aefb261a6574396bc11929f8d445360c5ffd (patch)
treec219c63a160caf55644e68dfdc3b5b3338c6d322 /proxy_wizard
parent73b46aef2e46fbd345e1186dc28c33ac64283e0f (diff)
downloaddrakwizard-8713aefb261a6574396bc11929f8d445360c5ffd.tar
drakwizard-8713aefb261a6574396bc11929f8d445360c5ffd.tar.gz
drakwizard-8713aefb261a6574396bc11929f8d445360c5ffd.tar.bz2
drakwizard-8713aefb261a6574396bc11929f8d445360c5ffd.tar.xz
drakwizard-8713aefb261a6574396bc11929f8d445360c5ffd.zip
first perl traduction
Diffstat (limited to 'proxy_wizard')
-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`;
+
+}