summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-scripts/net.modules.d/ifconfig')
-rw-r--r--net-scripts/net.modules.d/ifconfig8
1 files changed, 8 insertions, 0 deletions
diff --git a/net-scripts/net.modules.d/ifconfig b/net-scripts/net.modules.d/ifconfig
index 05ef95a..eacbd57 100644
--- a/net-scripts/net.modules.d/ifconfig
+++ b/net-scripts/net.modules.d/ifconfig
@@ -97,6 +97,14 @@ ifconfig_get_address() {
[[ -n ${x[0]} ]] && echo "${x[0]}/${x[1]}"
}
+# bool ifconfig_is_ethernet(char *interface)
+#
+# Return 0 if the link is ethernet, otherwise 1.
+ifconfig_is_ethernet() {
+ ifconfig "$1" | grep -q "^$1[[:space:]]*Link encap:Ethernet[[:space:]]"
+}
+
+
# void ifconfig_get_mac_address(char *interface)
#
# Fetch the mac address assingned to the network card