]> git.ipfire.org Git - network.git/commitdiff
Add detection for wireless devices.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 27 May 2012 11:58:29 +0000 (11:58 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 27 May 2012 11:58:29 +0000 (11:58 +0000)
functions.device

index 47187f58a3b663c935ff7053d3d9e00ea79021a9..f0dd1330fffaa2fb5fd9eda6a5ed094d4db06edb 100644 (file)
@@ -140,6 +140,13 @@ function device_is_loopback() {
        [ "${device}" = "lo" ]
 }
 
+# Check if the device is a wireless device
+function device_is_wireless() {
+       local device=${1}
+
+       [ -d "${SYS_CLASS_NET}/${device}/phy80211" ]
+}
+
 # Check if the device is a physical network interface
 function device_is_real() {
        local device=${1}
@@ -184,6 +191,9 @@ function device_get_type() {
        elif device_is_loopback ${device}; then
                echo "loopback"
 
+       elif device_is_wireless ${device}; then
+               echo "wireless"
+
        elif device_is_real ${device}; then
                echo "real"