diff options
author | Papoteur <papoteur@mageia.org> | 2021-02-06 19:03:13 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2021-02-06 19:03:13 +0100 |
commit | f9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36 (patch) | |
tree | f6a92fd12f37fbc4e60d8e66a50d071c17aa8226 | |
parent | c581d04b211682caa1d7f3daa1ec2a92524e882f (diff) | |
download | drakwizard-f9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36.tar drakwizard-f9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36.tar.gz drakwizard-f9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36.tar.bz2 drakwizard-f9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36.tar.xz drakwizard-f9c5c6f127d92bf9bbf695e19a12ffbb9d2f6a36.zip |
Get the default interface from route.
-rw-r--r-- | common/IFCFG.pm | 4 |
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 { |