Give -iprange a default, and check if it is free

This commit is contained in:
Bryan Boreham committed 2015-06-11 17:34:43 +01:00
1 parent 0e6569d78c
commit 465b16e668
1 file changed
+8
+8
View File
@@ -984,6 +984,14 @@ case "$COMMAND" in
esac
done
eval "set -- $ARGS"
if [ -z "$IPRANGE" ] ; then
IPRANGE="-iprange 10.128.0.0/9"
if ! netcheck ${IPRANGE#* } ; then
echo "Default" $IPRANGE "overlaps with existing route." >&2
echo "Please pick another range and set it on all hosts." >&2
exit 1
fi
fi
# Set WEAVE_DOCKER_ARGS in the environment in order to supply
# additional parameters, such as resource limits, to docker
# when launching the weave container.