cosmetic: move cidr functions to better place

This commit is contained in:
Matthias Radestock committed 2017-09-18 08:57:50 +01:00
1 parent 47597c941d
commit dd772f04fe
1 file changed
+14 -14
+14 -14
View File
@@ -186,20 +186,6 @@ check_docker_version() {
fi
}
is_cidr() {
echo "$1" | grep -E "^$CIDR_REGEXP$" >/dev/null
}
collect_cidr_args() {
CIDR_ARGS=""
CIDR_ARG_COUNT=0
while [ "$1" = "net:default" ] || is_cidr "$1" || is_cidr "${1#ip:}" || is_cidr "${1#net:}" ; do
CIDR_ARGS="$CIDR_ARGS ${1#ip:}"
CIDR_ARG_COUNT=$((CIDR_ARG_COUNT + 1))
shift 1
done
}
######################################################################
# main
######################################################################
@@ -901,6 +887,20 @@ collect_dns_add_remove_args() {
# IP Allocation Management helpers
######################################################################
is_cidr() {
echo "$1" | grep -E "^$CIDR_REGEXP$" >/dev/null
}
collect_cidr_args() {
CIDR_ARGS=""
CIDR_ARG_COUNT=0
while [ "$1" = "net:default" ] || is_cidr "$1" || is_cidr "${1#ip:}" || is_cidr "${1#net:}" ; do
CIDR_ARGS="$CIDR_ARGS ${1#ip:}"
CIDR_ARG_COUNT=$((CIDR_ARG_COUNT + 1))
shift 1
done
}
check_overlap() {
util_op netcheck $1 $BRIDGE
}