summaryrefslogtreecommitdiffstats
path: root/proxy_wizard/scripts/Squidconf.pm
blob: 877d60d5df945327bf8a381b1f0962884176eefb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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`;
    
}