From 4f0bfc954583c430ac42d9eeb55d7e730deed7d7 Mon Sep 17 00:00:00 2001 From: Christian Heim Date: Tue, 22 Nov 2005 13:58:47 +0000 Subject: Uberlord did a commit right after my, so i'm syncing it again; but this time to r1622. svn path=/baselayout-vserver/trunk/; revision=69 --- net-scripts/net.modules.d/vlan | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'net-scripts/net.modules.d/vlan') 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 -- cgit v1.2.3-65-gdbad