summaryrefslogtreecommitdiffstats
path: root/lib/network
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2009-08-14 15:31:28 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2009-08-14 15:31:28 +0000
commit6626fd4c393477c4686a7823c03660a983c3accf (patch)
tree94a5d50900308f3b497ae7235d0cce35d5b09768 /lib/network
parentf6dd7e7606c02842b2f787c3585c57c43bda2dcf (diff)
downloaddrakx-net-6626fd4c393477c4686a7823c03660a983c3accf.tar
drakx-net-6626fd4c393477c4686a7823c03660a983c3accf.tar.gz
drakx-net-6626fd4c393477c4686a7823c03660a983c3accf.tar.bz2
drakx-net-6626fd4c393477c4686a7823c03660a983c3accf.tar.xz
drakx-net-6626fd4c393477c4686a7823c03660a983c3accf.zip
Updated for new netprofile.
Diffstat (limited to 'lib/network')
-rw-r--r--lib/network/network.pm29
1 files changed, 6 insertions, 23 deletions
diff --git a/lib/network/network.pm b/lib/network/network.pm
index 79c63b0..8170d4a 100644
--- a/lib/network/network.pm
+++ b/lib/network/network.pm
@@ -399,43 +399,26 @@ sub gateway {
sub netprofile_set {
my ($net, $profile) = @_;
$net->{PROFILE} = $profile;
- system('/sbin/set-netprofile', $net->{PROFILE});
+ system('/sbin/netprofile', 'switch', $net->{PROFILE});
log::explanations(qq(Switching to "$net->{PROFILE}" profile));
}
-sub netprofile_save {
- my ($net) = @_;
- system('/sbin/save-netprofile', $net->{PROFILE});
- log::explanations(qq(Saving "$net->{PROFILE}" profile));
-}
-
sub netprofile_delete {
my ($profile) = @_;
- return if !$profile || $profile eq "default";
- rm_rf("$::prefix/etc/netprofile/profiles/$profile");
+ return if !$profile;
+ system('/sbin/netprofile', 'delete', $profile);
log::explanations(qq(Deleting "$profile" profile));
}
-sub netprofile_clone {
- my ($source_profile, $dest_profile) = @_;
- return if !$dest_profile || $dest_profile eq "default" || member($dest_profile, netprofile_list());
- system('/sbin/clone-netprofile', $source_profile, $dest_profile);
- log::explanations(qq("Creating "$dest_profile" profile));
-}
-
-sub netprofile_add {
- my ($net, $profile) = @_;
- netprofile_clone($net->{PROFILE}, $profile);
-}
-
sub netprofile_list() {
map { if_(m!([^/]*)/$!, $1) } glob("$::prefix/etc/netprofile/profiles/*/");
}
sub netprofile_read {
my ($net) = @_;
- my $config = { getVarsFromSh("$::prefix/etc/netprofile/current") };
- $net->{PROFILE} = $config->{PROFILE} || 'default';
+ my $profile = cat_("$::prefix/etc/netprofile/current");
+ chomp $profile if $profile;
+ $net->{PROFILE} = $profile || 'default';
}
sub advanced_settings_read {