summaryrefslogtreecommitdiffstats
path: root/perl-install/network/netconnect.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-12-02 20:41:44 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-12-02 20:41:44 +0000
commit9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6 (patch)
tree61aeae2581a101186add4569667ddac27876bd0e /perl-install/network/netconnect.pm
parent5ea5e381f9840d127fe444d8eecf34be4c45d0e6 (diff)
downloaddrakx-9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6.tar
drakx-9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6.tar.gz
drakx-9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6.tar.bz2
drakx-9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6.tar.xz
drakx-9519d51eb29b0a5881bc859e1c2b9b3b3a8abfa6.zip
use output_with_perm()
Diffstat (limited to 'perl-install/network/netconnect.pm')
-rw-r--r--perl-install/network/netconnect.pm28
1 files changed, 11 insertions, 17 deletions
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index f0ebedfc9..8f9b83136 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -138,16 +138,14 @@ sub main {
Click on Ok to keep your configuration, or cancel to reconfigure your Internet & Network connection.
"), 1)) and do {
$netcnx->{type} = 'lan';
- output "$prefix$connect_file",
+ output_with_perm("$prefix$connect_file", 0755,
qq(
ifup eth0
-);
- output "$prefix$disconnect_file",
+));
+ output("$prefix$disconnect_file", 0755,
qq(
ifdown eth0
-);
- chmod 0755, "$prefix$disconnect_file";
- chmod 0755, "$prefix$connect_file";
+));
$direct_net_install = 1;
goto step_5;
};
@@ -283,9 +281,9 @@ Test your connection via net_monitor or mcc. If your connection doesn't work, yo
$network_configured or network::configureNetwork2($in, $prefix, $netc, $intf);
+ my $connect_cmd;
if ($netcnx->{type} =~ /modem/ || $netcnx->{type} =~ /isdn_external/) {
- output "$prefix$connect_prog",
- qq(
+ $connect_cmd = qq(
#!/bin/bash
if [ -n "\$DISPLAY" ]; then
if [ -e /usr/bin/kppp ]; then
@@ -299,8 +297,7 @@ $connect_file
fi
);
} elsif ($netcnx->{type}) {
- output "$prefix$connect_prog",
- qq(
+ $connect_cmd = qq(
#!/bin/bash
if [ -n "\$DISPLAY" ]; then
/usr/sbin/net_monitor --connect
@@ -309,15 +306,13 @@ $connect_file
fi
);
} else {
- output "$prefix$connect_prog",
- qq(
+ $connect_cmd = qq(
#!/bin/bash
/usr/sbin/drakconnect
);
}
if ($direct_net_install) {
- output "$prefix$connect_prog",
- qq(
+ $connect_cmd = qq(
#!/bin/bash
if [ -n "\$DISPLAY" ]; then
/usr/sbin/net_monitor --connect
@@ -326,7 +321,7 @@ $connect_file
fi
);
}
- chmod 0755, "$prefix$connect_prog";
+ output_with_perm("$prefix$connect_prog", 0755, $connect_cmd) if $connect_cmd;
$netcnx->{$_} = $netc->{$_} foreach qw(NET_DEVICE NET_INTERFACE);
$netcnx->{NET_INTERFACE} and set_net_conf($netcnx, $netc);
@@ -354,7 +349,7 @@ sub save_conf {
$intf = { %$intf };
- output("$prefix/etc/sysconfig/network-scripts/drakconnect_conf",
+ output_with_perm("$prefix/etc/sysconfig/network-scripts/drakconnect_conf", 0600,
"SystemName=" . do { $netc->{HOSTNAME} =~ /([^\.]*)\./; $1 } . "
DomainName=" . do { $netc->{HOSTNAME} =~ /\.(.*)/; $1 } . "
InternetAccessType=" . do { if ($netcnx->{type}) { $netcnx->{type} } else { $netc->{GATEWAY} ? "lan" : "" } } . "
@@ -430,7 +425,6 @@ ADSLLogin=$adsl->{login}
ADSLPassword=$adsl->{passwd}
DOMAINNAME2=$netc->{DOMAINNAME2}"
);
- chmod 0600, "$prefix/etc/sysconfig/network-scripts/drakconnect_conf";
my $a = $netcnx->{PROFILE} ? $netcnx->{PROFILE} : "default";
cp_af("$prefix/etc/sysconfig/network-scripts/drakconnect_conf", "$prefix/etc/sysconfig/network-scripts/drakconnect_conf." . $a);
chmod 0600, "$prefix/etc/sysconfig/network-scripts/drakconnect_conf";