However, this is not a very good idea at this
level anymore. The colours may confuse and the
difference between them is not very huge at all.
So from now on, there will be lanN and uplN
which represent local networks and uplinks respectively.
DISCOVER_ERROR=1
DISCOVER_NOT_SUPPORTED=2
-# The user is able to create zones that begin with these names
-VALID_ZONES="green orange red grey"
+# The user is able to create zones that begin
+# with these names followed by a number.
+ZONE_LOCAL="lan"
+ZONE_NONLOCAL="upl"
+VALID_ZONES="${ZONE_LOCAL} ${ZONE_NONLOCAL}"
SYS_CLASS_NET="/sys/class/net"
function zone_is_local() {
local zone=${1}
- ! zone_is_nonlocal ${zone}
+ [[ "${zone:0:${#ZONE_LOCAL}}" = "${ZONE_LOCAL}" ]]
}
function zone_is_nonlocal() {
local zone=${1}
- assert isset zone
-
- [[ ${zone} =~ ^red[0-9]{1,5} ]]
+ [[ "${zone:0:${#ZONE_NONLOCAL}}" = "${ZONE_NONLOCAL}" ]]
}
function zone_get_hook() {