summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-02-17 17:39:30 +0000
committerOlivier Blin <oblin@mandriva.org>2005-02-17 17:39:30 +0000
commit96f7d977bc02e9d1d50b30446e5c8bf6d23761cc (patch)
tree610972fae5a2967e2d203ec02ab389689d24ae2a
parent4db98db63327456fbd64b0302eaacff7dd6820aa (diff)
downloaddrakx-96f7d977bc02e9d1d50b30446e5c8bf6d23761cc.tar
drakx-96f7d977bc02e9d1d50b30446e5c8bf6d23761cc.tar.gz
drakx-96f7d977bc02e9d1d50b30446e5c8bf6d23761cc.tar.bz2
drakx-96f7d977bc02e9d1d50b30446e5c8bf6d23761cc.tar.xz
drakx-96f7d977bc02e9d1d50b30446e5c8bf6d23761cc.zip
definitively get rid off net_cnx scripts
-rw-r--r--perl-install/network/shorewall.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl-install/network/shorewall.pm b/perl-install/network/shorewall.pm
index 2f15dbaa1..338c8dd2d 100644
--- a/perl-install/network/shorewall.pm
+++ b/perl-install/network/shorewall.pm
@@ -124,7 +124,8 @@ sub read {
sub write {
my ($conf) = @_;
- my $connect_file = "/etc/sysconfig/network-scripts/net_cnx_up";
+ my $default_dev = get_default_device();
+ my $use_pptp = $default_dev =~ /^ppp/ && cat_("$::prefix/etc/ppp/peers/$default_dev") =~ /pptp/;
my $squid_port = network::network::read_squid_conf()->{http_port}[0];
my %ports_by_proto;
@@ -148,8 +149,8 @@ sub write {
[ 'all', 'all', 'REJECT', 'info' ],
);
set_config_file('rules',
- if_(cat_("$::prefix$connect_file") =~ /pptp/, [ 'ACCEPT', 'fw', 'loc:10.0.0.138', 'tcp', '1723' ]),
- if_(cat_("$::prefix$connect_file") =~ /pptp/, [ 'ACCEPT', 'fw', 'loc:10.0.0.138', 'gre' ]),
+ if_($use_pptp, [ 'ACCEPT', 'fw', 'loc:10.0.0.138', 'tcp', '1723' ]),
+ if_($use_pptp, [ 'ACCEPT', 'fw', 'loc:10.0.0.138', 'gre' ]),
(map {
map_each { [ 'ACCEPT', $_, 'fw', $::a, join(',', @$::b), '-' ] } %ports_by_proto;
} ('net', if_($conf->{loc_interface}[0], 'loc'))),