summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-01-26 17:00:28 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-01-26 17:00:28 +0000
commit9ba81bbbe9b45ecb8af22c8563a50f9da61af966 (patch)
treef1358a1ed951283a92e7709d6e3d6ac1b9a19ddb /perl-install/standalone
parent650f81d5b9b764b4ee897e0b04f936dadcfafa9f (diff)
downloaddrakx-backup-do-not-use-9ba81bbbe9b45ecb8af22c8563a50f9da61af966.tar
drakx-backup-do-not-use-9ba81bbbe9b45ecb8af22c8563a50f9da61af966.tar.gz
drakx-backup-do-not-use-9ba81bbbe9b45ecb8af22c8563a50f9da61af966.tar.bz2
drakx-backup-do-not-use-9ba81bbbe9b45ecb8af22c8563a50f9da61af966.tar.xz
drakx-backup-do-not-use-9ba81bbbe9b45ecb8af22c8563a50f9da61af966.zip
get rid of global variables regarding connect/disconnect scripts
Diffstat (limited to 'perl-install/standalone')
-rwxr-xr-xperl-install/standalone/drakconnect18
-rwxr-xr-xperl-install/standalone/net_monitor11
2 files changed, 9 insertions, 20 deletions
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect
index 165f3b5ad..55fa55064 100755
--- a/perl-install/standalone/drakconnect
+++ b/perl-install/standalone/drakconnect
@@ -38,7 +38,7 @@ use c;
use modules;
use network::isdn;
use network::adsl;
-use MDK::Common::Globals "network", qw($in $prefix $disconnect_file $connect_prog $connect_file);
+use MDK::Common::Globals "network", qw($in);
use POSIX ":sys_wait_h";
my ($netcnx, $netc, $intf) = ({}, {}, {});
@@ -53,13 +53,7 @@ reread_net_conf();
$::Wizard_title = N("Network & Internet Configuration");
$::Wizard_pix_up = "wiz_drakconnect.png";
-MDK::Common::Globals::init(
- in => $in,
- prefix => '',
- connect_file => "/etc/sysconfig/network-scripts/net_cnx_up",
- disconnect_file => "/etc/sysconfig/network-scripts/net_cnx_down",
- connect_prog => "/etc/sysconfig/network-scripts/net_cnx_pg"
- );
+MDK::Common::Globals::init(in => $in);
local $_ = join '', @ARGV;
/--skip-wizard/ and manage($netc, $netcnx, $intf);
@@ -99,8 +93,8 @@ my $int_connect = Gtk2::Button->new(N("Wait please"));
$int_connect->set_sensitive(0);
$int_connect->signal_connect(clicked => sub {
if (!$isconnected) {
- if (cat_($connect_prog) =~ m|/usr/bin/kppp| && -e '/usr/bin/kppp') {
- run_program::rooted($prefix, "/usr/bin/kppp &");
+ if (cat_($network::tools::connect_prog) =~ m|/usr/bin/kppp| && -e '/usr/bin/kppp') {
+ run_program::run("/usr/bin/kppp &");
} else {
connect_backend();
}
@@ -603,9 +597,9 @@ sub apply {
network::network::sethostname($netc) if is_dynamic_ip($intf);
- network::network::configureNetwork2($in, $prefix, $netc, $intf);
+ network::network::configureNetwork2($in, '', $netc, $intf);
$netcnx->{type} =~ /adsl/ or system("/sbin/chkconfig --del adsl 2> /dev/null");
- $netcnx->{type} !~ /adsl_p/ and system("$prefix/etc/rc.d/init.d/network restart");
+ $netcnx->{type} !~ /adsl_p/ and system("/etc/rc.d/init.d/network restart");
$button_apply->set_sensitive(0);
}
diff --git a/perl-install/standalone/net_monitor b/perl-install/standalone/net_monitor
index 2530f891f..6594e61dc 100755
--- a/perl-install/standalone/net_monitor
+++ b/perl-install/standalone/net_monitor
@@ -30,7 +30,7 @@ use ugtk2 qw(:helpers :wrappers :create);
use common;
use network::netconnect;
use network::tools;
-use MDK::Common::Globals "network", qw($in $prefix $connect_file $disconnect_file $connect_prog);
+use MDK::Common::Globals "network", qw($in);
if ("@ARGV" =~ /--status/) { print connected(); exit(0) }
my $force = "@ARGV" =~ /--force/;
@@ -75,12 +75,7 @@ my ($width, $height) = (300, 150);
network::netconnect::load_conf($netcnx, $netc, $intf);
network::netconnect::read_net_conf('', $netcnx, $netc);
-MDK::Common::Globals::init(
- in => $in,
- prefix => '',
- connect_file => "/etc/sysconfig/network-scripts/net_cnx_up",
- disconnect_file => "/etc/sysconfig/network-scripts/net_cnx_down",
- connect_prog => "/etc/sysconfig/network-scripts/net_cnx_pg");
+MDK::Common::Globals::init(in => $in);
gtkadd($window1->{window},
gtkpack_(Gtk2::VBox->new(0,5),
@@ -423,7 +418,7 @@ sub update() {
$button_connect->set("label", $isconnected == 1 ? N("Disconnect %s", $netcnx->{type}) : N("Connect %s", $netcnx->{type}));
$button_connect->set_sensitive(1);
}
- if (!(-e $connect_file && -e $disconnect_file)) {
+ if (!(-e $network::tools::connect_file && -e $network::tools::disconnect_file)) {
$button_connect->set_sensitive(0);
$button_connect->set("label", N("No internet connection configured"));
}