summaryrefslogtreecommitdiffstats
path: root/proxy_wizard/Squid.pm
diff options
context:
space:
mode:
Diffstat (limited to 'proxy_wizard/Squid.pm')
-rwxr-xr-xproxy_wizard/Squid.pm7
1 files changed, 7 insertions, 0 deletions
diff --git a/proxy_wizard/Squid.pm b/proxy_wizard/Squid.pm
index e2687b33..04c97629 100755
--- a/proxy_wizard/Squid.pm
+++ b/proxy_wizard/Squid.pm
@@ -29,6 +29,8 @@ use services;
use MDK::Wizard::Wizcommon;
my $wiz = new MDK::Wizard::Wizcommon;
+my $HOSTNAME = $wiz->{net}->network_get("HOSTNAME");
+if (!$HOSTNAME) { $HOSTNAME = chomp_(`hostname`) }
my $df = -d '/var/spool/squid' ? `/bin/df -m /var/spool/squid` : `/bin/df -m /var/spool`;
my ($free_disk) = $df =~ m/\d+\s+\d+\s+\d+\s+(\d+)/;
my $mem = `/usr/bin/free -m`;
@@ -274,6 +276,11 @@ level = $o->{var}{wiz_squid_level}");
}
append_to_file($file, "cache_peer $o->{var}{wiz_squid_cachepeer} parent $o->{var}{wiz_squid_peerport} 3130");
}
+
+ substInFile {
+ s|^visible_hostname.*|visible_hostname $HOSTNAME|;
+ } $file;
+
system("/sbin/chkconfig --level 345 squid on");
if (services::is_service_running('squid')) {
services::restart('squid')