summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-scripts/net.modules.d/vlan')
-rw-r--r--net-scripts/net.modules.d/vlan10
1 files changed, 9 insertions, 1 deletions
diff --git a/net-scripts/net.modules.d/vlan b/net-scripts/net.modules.d/vlan
index 2c6894e..e35196a 100644
--- a/net-scripts/net.modules.d/vlan
+++ b/net-scripts/net.modules.d/vlan
@@ -22,13 +22,21 @@ vlan_depend() {
# bool vlan_check_installed(void)
#
-# Returns 1 if vconfig is installed, otherwise 0
+# Returns 0 if vconfig is installed, otherwise 1
vlan_check_installed() {
[[ -x /sbin/vconfig ]] && return 0
${1:-false} && eerror "For VLAN (802.1q) support, emerge net-misc/vconfig"
return 1
}
+# bool vlan_exists(char *interface)
+#
+# Returns 0 if the interface is a vlan, otherwise 1
+vlan_exists() {
+ [[ ! -d /proc/net/vlan ]] && return 1
+ egrep -q "^$1[[:space:]]+" /proc/net/vlan/config
+}
+
# char* vlan_get_vlans(char *interface)
#
# Fetch the configured vlans for an interface. Outputs a space