summaryrefslogtreecommitdiffstats
path: root/bin/draknetadvanced
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2009-01-20 12:45:33 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2009-01-20 12:45:33 +0000
commit983a1c6b96950e142ef9752c61b31c359d5fcad6 (patch)
treec3afc562695b5667b912a8592d88cd0ee6d5caee /bin/draknetadvanced
parent86393f41bc45f4e1f87771ad5bd4d510a0d30863 (diff)
downloaddrakx-net-983a1c6b96950e142ef9752c61b31c359d5fcad6.tar
drakx-net-983a1c6b96950e142ef9752c61b31c359d5fcad6.tar.gz
drakx-net-983a1c6b96950e142ef9752c61b31c359d5fcad6.tar.bz2
drakx-net-983a1c6b96950e142ef9752c61b31c359d5fcad6.tar.xz
drakx-net-983a1c6b96950e142ef9752c61b31c359d5fcad6.zip
Moved advanced network settings to draknetcenter, and removed draknetadvanced.
Diffstat (limited to 'bin/draknetadvanced')
-rwxr-xr-xbin/draknetadvanced77
1 files changed, 0 insertions, 77 deletions
diff --git a/bin/draknetadvanced b/bin/draknetadvanced
deleted file mode 100755
index 9c88040..0000000
--- a/bin/draknetadvanced
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/usr/bin/perl
-
-# DrakNetAdvanced
-
-# Copyright (C) 2009 Mandriva (eugeni@mandriva.com)
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-use lib qw(/usr/lib/libDrakX);
-
-# i18n: IMPORTANT: to get correct namespace (drakx-net instead of libDrakX)
-BEGIN { unshift @::textdomains, 'drakx-net' }
-use standalone; #- warning, standalone must be loaded very first, for 'explanations'
-use interactive;
-use network::network;
-use any;
-use common;
-
-sub replace_in_file {
- my ($f, $old, $new) = @_;
- my @lines;
- foreach (cat_($f)) {
- # remove
- /$old/ or push(@lines, $_);
- }
- open(my $F, ">$f") or die "output in file $f failed: $!\n";
- foreach (@lines) {
- print $F $_;
- }
- # saving new line
- $new and print $F $new."\n";
- close($F);
-}
-
-$ugtk2::wm_icon = "/usr/share/mcc/themes/default/drakproxy-mdk.png";
-my $modprobe = "$::prefix/etc/modprobe.conf";
-my $sysctl = "$::prefix/etc/sysctl.conf";
-
-# ipv6
-my $ipv6_disabled=0;
-foreach (cat_($modprobe)) {
- /^install ipv6 \/bin\/true$/ and $ipv6_disabled=1;
-} cat_($modprobe);
-
-# sysctl
-my $window_scaling=0;
-foreach (cat_($sysctl)) {
- /^net\.ipv4\.tcp_window_scaling\s*=\s*0/ and $window_scaling=1;
-} cat_($modprobe);
-
-my $u = { ipv6_disabled => $ipv6_disabled, window_scaling => $window_scaling };
-my $in = 'interactive'->vnew('su');
-if (network::network::advanced_choose($in, $u)) {
- if ($u->{ipv6_disabled}) {
- replace_in_file("$::prefix/etc/modprobe.conf", "^install ipv6", "install ipv6 \/bin\/true");
- } else {
- replace_in_file("$::prefix/etc/modprobe.conf", "^install ipv6 \/bin\/true");
- }
- if ($u->{window_scaling}) {
- replace_in_file("$::prefix/etc/sysctl.conf", "^net.ipv4.tcp_window_scaling", "net.ipv4.tcp_window_scaling=0");
- } else {
- replace_in_file("$::prefix/etc/sysctl.conf", "net\.ipv4\.tcp_window_scaling", "net.ipv4.tcp_window_scaling=1");
- }
-}
-$in->exit(0);