diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2021-02-10 18:57:18 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2021-02-10 19:16:35 +0100 |
commit | 85873eb864a156d0e7918fde6232882baa940122 (patch) | |
tree | 32693b0fb1e6a78b5cb25ca7fb8420574d6f2ddd /common | |
parent | 45ee1aa2b386a1b226b93156cd04a5526f4c909b (diff) | |
download | drakwizard-85873eb864a156d0e7918fde6232882baa940122.tar drakwizard-85873eb864a156d0e7918fde6232882baa940122.tar.gz drakwizard-85873eb864a156d0e7918fde6232882baa940122.tar.bz2 drakwizard-85873eb864a156d0e7918fde6232882baa940122.tar.xz drakwizard-85873eb864a156d0e7918fde6232882baa940122.zip |
Use Net::Route function to get default interface
Diffstat (limited to 'common')
-rw-r--r-- | common/IFCFG.pm | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/common/IFCFG.pm b/common/IFCFG.pm index 09fc49ef..a8953487 100644 --- a/common/IFCFG.pm +++ b/common/IFCFG.pm @@ -26,6 +26,7 @@ use lib qw(/usr/lib/libDrakX); use MDK::Common; use network::network; use detect_devices; +require Net::Route::Table; #my $file = "/etc/sysconfig/network-scripts/drakconnect_conf"; #!-f $file and die "no such $file"; @@ -95,9 +96,7 @@ sub is_dhcp { } sub default_itf { - local $_ = `/sbin/route | grep default | tr -s " " | cut -d " " -f8`; - s/\n$//; - $_; + return eval { Net::Route::Table->from_system->default_route->interface }; } sub itf_get { |