summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2021-02-06 19:03:13 +0100
committerPapoteur <papoteur@mageia.org>2021-02-06 19:03:13 +0100
commitf9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36 (patch)
treef6a92fd12f37fbc4e60d8e66a50d071c17aa8226 /common
parentc581d04b211682caa1d7f3daa1ec2a92524e882f (diff)
downloaddrakwizard-f9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36.tar
drakwizard-f9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36.tar.gz
drakwizard-f9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36.tar.bz2
drakwizard-f9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36.tar.xz
drakwizard-f9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36.zip
Get the default interface from route.
Diffstat (limited to 'common')
-rw-r--r--common/IFCFG.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/IFCFG.pm b/common/IFCFG.pm
index a9a13037..ca9cb71e 100644
--- a/common/IFCFG.pm
+++ b/common/IFCFG.pm
@@ -64,7 +64,9 @@ sub is_dhcp {
#- TODO : return the main interface
sub default_itf {
- "eth0";
+ $_ = `/sbin/route | grep default | tr -s " " | cut -d " " -f8`;
+ s/\n$//;
+ "$_";
}
sub itf_get {