summaryrefslogtreecommitdiffstats
path: root/bin/drakgw
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-03-26 16:07:03 +0000
committerOlivier Blin <oblin@mandriva.com>2008-03-26 16:07:03 +0000
commita05d77162e04462a1e1a9c32790c8b85558ac5c6 (patch)
treeeaef524e4908f28a81242e1031c2f8aaf1603424 /bin/drakgw
parent8f568abd1a9883a2c591120baffc847f1f204284 (diff)
downloaddrakx-net-a05d77162e04462a1e1a9c32790c8b85558ac5c6.tar
drakx-net-a05d77162e04462a1e1a9c32790c8b85558ac5c6.tar.gz
drakx-net-a05d77162e04462a1e1a9c32790c8b85558ac5c6.tar.bz2
drakx-net-a05d77162e04462a1e1a9c32790c8b85558ac5c6.tar.xz
drakx-net-a05d77162e04462a1e1a9c32790c8b85558ac5c6.zip
use network::shorewall::set_redirected_ports helper
Diffstat (limited to 'bin/drakgw')
-rwxr-xr-xbin/drakgw17
1 files changed, 2 insertions, 15 deletions
diff --git a/bin/drakgw b/bin/drakgw
index bbd50cd..7177909 100755
--- a/bin/drakgw
+++ b/bin/drakgw
@@ -282,11 +282,7 @@ If you do not know the meaning of an option, simply leave it as it is."),
post => sub {
network::squid::write_squid_conf($squid_conf, $lan_intf, $internal_domain_name) if $use_caching_proxy;
services::set_status("squid", $use_caching_proxy);
- if ($use_caching_proxy) {
- set_proxy_port($squid_conf->{http_port}[0]);
- } else {
- delete_proxy_ports();
- }
+ network::shorewall::set_redirected_ports($shorewall, 'tcp', $squid_conf->{http_port}[0], if_($use_caching_proxy, 'www'));
-f $cups_conf ? "cups" : end_step();
},
},
@@ -344,20 +340,11 @@ sub end_step() {
"end";
}
-sub delete_proxy_ports() {
- delete $shorewall->{redirects}{tcp}{www};
-}
-
-sub set_proxy_port {
- my ($port) = @_;
- $shorewall->{redirects}{tcp}{www} = $port;
-}
-
sub gw_disable() {
my $_wait_disabl = $in->wait_message(N("Please wait"), N("Disabling servers..."));
return if $::testing;
services::set_status($_, 0) foreach qw(dhcpd squid named);
- delete_proxy_ports();
+ network::shorewall::set_redirected_ports($shorewall, 'tcp', $squid_conf->{http_port}[0], ());
network::shorewall::write($shorewall);
foreach ($network::dhcpd::dhcpd_conf_file, $network::squid::squid_conf_file, $masq_file) {
if (-f $_) { rename($_, "$_.drakgwdisable") or die "Could not rename $_ to $_.drakgwdisable" }