From: Michael Tremer Date: Thu, 17 Jun 2010 22:57:01 +0000 (+0200) Subject: network: New function device_is_promisc. X-Git-Tag: 001~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e4c26a48a3bcac756425fbfe27a5be01e442192;p=network.git network: New function device_is_promisc. --- diff --git a/functions.device b/functions.device index 025e178a..8f288713 100644 --- a/functions.device +++ b/functions.device @@ -246,6 +246,12 @@ function device_has_carrier() { [ "$(<${SYS_CLASS_NET}/${device}/carrier)" = "1" ] } +function device_is_promisc() { + local device=${1} + + ip link show ${device} | grep -qE "<.*PROMISC.*>" +} + # Check if the device is free function device_is_free() { ! device_is_used $@