summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xproxy_wizard/Squid.pm26
1 files changed, 12 insertions, 14 deletions
diff --git a/proxy_wizard/Squid.pm b/proxy_wizard/Squid.pm
index 9f15461e..ff9559e2 100755
--- a/proxy_wizard/Squid.pm
+++ b/proxy_wizard/Squid.pm
@@ -64,10 +64,10 @@ my $o = {
init => sub {
my ($err, $msg) = test_host_domain($SHORTHOSTNAME, $DOMAINNAME);
if (!$err) {
- $in->ask_warn(N('Error'), $msg);
+ $in->ask_warn(N("Error"), $msg);
die 'wizcancel';
}
- ($err, $msg)
+ ($err, $msg);
},
needed_rpm => [ 'squid' ],
defaultimage => "/usr/share/mcc/themes/default/drakproxy-mdk.png",
@@ -122,14 +122,14 @@ $o->{pages} = {
{ label => '', val => \$o->{var}{wiz_squid_level}, list => [ keys %level ], format => sub { $level{$_[0]} } },
],
post => sub {
- return 'shownet' if $o->{var}{wiz_squid_level} == 2
+ return 'shownet' if $o->{var}{wiz_squid_level} == 2;
},
next => 'cachepeer'
},
shownet => {
name => N("Grant access on local network") . "\n\n" . N("Access will be allowed for hosts on the network. Here is the information found about your current local network, you can modify it if needed.") . "\n\n" . N("You can use either a numeric format like \"192.168.1.0/255.255.255.0\" or a text format like \".domain.net\""),
pre => sub {
- $o->{var}{wiz_squid_mynetw} ||= network_mask()
+ $o->{var}{wiz_squid_mynetw} ||= network_mask();
},
data => [
{ label => N("Authorized network:"), val => \$o->{var}{wiz_squid_mynetw}, help => N("Use numeric format like \"192.168.1.0/255.255.255.0\" or a text format like \".domain.net\"") },
@@ -139,13 +139,13 @@ $o->{pages} = {
cachepeer => {
name => N("Cache hierarchy") . "\n\n" . N("As an option, Squid can be configured in proxy cascading. You can add a new upper level proxy by specifying its hostname and port.") . "\n\n" . N("You can safely select \"No upper level proxy\" if you don't need this feature."),
pre => sub {
- $o->{var}{wiz_squid_menupeer} ||= 1
+ $o->{var}{wiz_squid_menupeer} ||= 1;
},
data => [
{ label => '', val => \$o->{var}{wiz_squid_menupeer}, list => [ keys %upper ], format => sub { $upper{$_[0]} } },
],
post => sub {
- return 'valcachepeer' if $o->{var}{wiz_squid_menupeer} == 2
+ return 'valcachepeer' if $o->{var}{wiz_squid_menupeer} == 2;
},
next => 'summary_2'
},
@@ -207,15 +207,13 @@ sub network_mask {
sub testport {
if ($o->{var}{wiz_squid_port} == 3128 || $o->{var}{wiz_squid_port} == 8080) {
- return ''
+ return '';
}
elsif ($o->{var}{wiz_squid_port} <= 1024 || $o->{var}{wiz_squid_port} >= 65536) {
return 'error_low';
}
$o->{var}{used_by} = `/bin/grep $o->{var}{wiz_squid_port} /etc/services`;
- if ($o->{var}{used_by}) {
- return 'warning_port'
- }
+ return 'warning_port' if $o->{var}{used_by};
}
sub port {
@@ -234,7 +232,7 @@ sub do_it {
check_starts_on_boot($in, 'squid');
my $w = $in->wait_message(N("Squid proxy"), N("Configuring your system as a Proxy server..."));
my $file="/etc/squid/squid.conf";
- -f $file and MDK::Common::cp_af($file, $file.".orig");
+ -f $file and MDK::Common::cp_af($file, $file . ".orig");
MDK::Common::cp_af("__WIZ_HOME__/proxy_wizard/scripts/squid.conf.default", $file);
substInFile {
s|^\s*#?\s*cache_dir ufs /var/spool/squid 100 16 256.*|cache_dir ufs $o->{var}{wiz_squid_defdir} $o->{var}{wiz_squid_disk} 16 256|;
@@ -267,7 +265,7 @@ level = $o->{var}{wiz_squid_level}");
my $t = 0;
foreach (cat_($file)) {
if (/^\s*cache_peer/) {
- $t = $_;;
+ $t = $_;
last;
}
}
@@ -291,9 +289,9 @@ level = $o->{var}{wiz_squid_level}");
system("/sbin/chkconfig --level 345 squid on");
if (services::is_service_running('squid')) {
- services::restart('squid')
+ services::restart('squid');
} else {
- services::start('squid')
+ services::start('squid');
}
undef $w;
check_started('squid');