Remove silly debian-specific code that doesn't use ifconfig to bring up interfaces
authorJamie Cameron <jcameron@webmin.com>
Thu, 29 Oct 2009 18:18:27 +0000 (11:18 -0700)
committerJamie Cameron <jcameron@webmin.com>
Thu, 29 Oct 2009 18:18:27 +0000 (11:18 -0700)
net/linux-lib.pl

index bb6a2e9..3bfb52f 100755 (executable)
@@ -95,14 +95,6 @@ if($a->{'vlan'} == 1) {
        }
 
 local $cmd;
-if (($gconfig{'os_type'} eq 'debian-linux') && ($gconfig{'os_version'} >= 5)) {
-       if ($a->{'up'}) { $cmd .= "ifup $a->{'name'}"; }
-       else { $cmd .= "ifdown $a->{'name'}"; }
-       local $out = &backquote_logged("$cmd 2>&1");
-       if ($?) { &error($out); }
-}
-else {
-
 if($a->{'vlan'} == 1) {
        $cmd .= "ifconfig $a->{'physical'}.$a->{'vlanid'}";
        }
@@ -131,7 +123,6 @@ if ($a->{'ether'}) {
        if ($?) { &error($out); }
        }
 }
-}
 
 # deactivate_interface(&details)
 # Shutdown some active interface
@@ -147,26 +138,21 @@ if ($_[0]->{'virtual'} ne "") {
        # Shutdown virtual interface by setting address to 0
        local $out = &backquote_logged("ifconfig $name 0 2>&1");
        }
- elsif (&is_ipv6_address($address)){
-    local $out = &backquote_logged("ifconfig $name inet6 del $address/$netmask 2>&1");
-  }
+elsif (&is_ipv6_address($address)){
+       local $out = &backquote_logged("ifconfig $name inet6 del $address/$netmask 2>&1");
+       }
 local ($still) = grep { $_->{'fullname'} eq $name } &active_interfaces();
 if ($still && !&is_ipv6_address($address)) {
        # Old version of ifconfig or non-virtual interface.. down it
-       if (($gconfig{'os_type'} eq 'debian-linux') && ($gconfig{'os_version'} >= 5)) {
-               local $out = &backquote_logged("ifdown $name 2>&1");    
-       }
-       else {
-               local $out = &backquote_logged("ifconfig $name down 2>&1");
-               local ($still) = grep { $_->{'fullname'} eq $name }
-                             &active_interfaces();
-               if ($still) {
-                       &error("<pre>$out</pre>");
-               }
+       local $out = &backquote_logged("ifconfig $name down 2>&1");
+       local ($still) = grep { $_->{'fullname'} eq $name }
+                     &active_interfaces();
+       if ($still) {
+               &error("<pre>$out</pre>");
        }
        if(&iface_type($name) =~ /^(.*) (VLAN)$/) {
                $out = &backquote_logged("vconfig rem $name 2>&1");
-       }
+               }
        }
 }