summaryrefslogtreecommitdiffstats
path: root/perl-install/network/shorewall.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-03-24 09:59:47 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-03-24 09:59:47 +0000
commitfbbcf8129f8c931cea1279ea5589bd657155be4f (patch)
treeb13208bdc47464e7a05809a6a1d47cbf125a29d5 /perl-install/network/shorewall.pm
parent86f242fd200194724a068de6474fb9d97a480355 (diff)
downloaddrakx-fbbcf8129f8c931cea1279ea5589bd657155be4f.tar
drakx-fbbcf8129f8c931cea1279ea5589bd657155be4f.tar.gz
drakx-fbbcf8129f8c931cea1279ea5589bd657155be4f.tar.bz2
drakx-fbbcf8129f8c931cea1279ea5589bd657155be4f.tar.xz
drakx-fbbcf8129f8c931cea1279ea5589bd657155be4f.zip
- network::shorewall::default_interfaces_silent() does not need any parameter
- network::shorewall::read() is simpler with a $o_in - network::drakfirewall::default_from_pkgs() is non interactive, better give it a do_pkgs - cleanup as little as possible
Diffstat (limited to 'perl-install/network/shorewall.pm')
-rw-r--r--perl-install/network/shorewall.pm18
1 files changed, 7 insertions, 11 deletions
diff --git a/perl-install/network/shorewall.pm b/perl-install/network/shorewall.pm
index 563914578..eb3a4e045 100644
--- a/perl-install/network/shorewall.pm
+++ b/perl-install/network/shorewall.pm
@@ -61,11 +61,10 @@ sub get_net_device() {
$default_dev;
}
-sub default_interfaces_silent {
- my ($_in) = @_;
- my %conf;
- my @l = detect_devices::getNet() or return;
- if (@l == 1) {
+sub default_interfaces_silent() {
+ my %conf;
+ my @l = detect_devices::getNet() or return;
+ if (@l == 1) {
$conf{net_interface} = $l[0];
} else {
$conf{net_interface} = get_net_device() || $l[0];
@@ -103,7 +102,7 @@ Examples:
}
sub read {
- my ($in, $mode) = @_;
+ my ($o_in) = @_;
my %conf = (disabled => !glob_("$::prefix/etc/rc3.d/S*shorewall"),
ports => join(' ', map {
my $e = $_;
@@ -114,11 +113,8 @@ sub read {
if (my ($e) = get_config_file('masq')) {
$conf{masquerade}{subnet} = $e->[1] if $e->[1];
}
- if ($mode eq 'silent') {
- put_in_hash(\%conf, default_interfaces_silent($in));
- } else {
- put_in_hash(\%conf, default_interfaces($in));
- }
+ put_in_hash(\%conf, $o_in ? default_interfaces($o_in) : default_interfaces_silent());
+
$conf{net_interface} && \%conf;
}