summaryrefslogtreecommitdiffstats
path: root/proxy_wizard/Squid.pm
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2004-07-29 04:53:03 +0000
committerAntoine Ginies <aginies@mandriva.com>2004-07-29 04:53:03 +0000
commit49ff463da29d3a86e9ca9fb58ddd41d14cdd8212 (patch)
treee5eb6cb4446bf58c62ebb0ad9a8e55d55163a107 /proxy_wizard/Squid.pm
parent8baca913533b51580e7cc2288a8ee4d3db01be45 (diff)
downloaddrakwizard-49ff463da29d3a86e9ca9fb58ddd41d14cdd8212.tar
drakwizard-49ff463da29d3a86e9ca9fb58ddd41d14cdd8212.tar.gz
drakwizard-49ff463da29d3a86e9ca9fb58ddd41d14cdd8212.tar.bz2
drakwizard-49ff463da29d3a86e9ca9fb58ddd41d14cdd8212.tar.xz
drakwizard-49ff463da29d3a86e9ca9fb58ddd41d14cdd8212.zip
fix missing visible_hostname in config file
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')