Skip to content

Commit cde4726

Browse files
committed
Add ipv4 subnet option
1 parent ed98f95 commit cde4726

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

bin/fresh-start.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,15 @@ while [[ $# -gt 0 ]]; do
429429
shift 1
430430
;;
431431

432+
# IPv4 options
433+
--ipv4-subnet=*)
434+
ARG_IPv4_SUBNET="${1#*=}"
435+
if [[ $ARG_IPv4_SUBNET == "" ]]; then
436+
echoerror "Invalid option for --ipv4-subnet"
437+
break
438+
fi
439+
shift 1
440+
;;
432441
# IPv6 options
433442
--ipv6-subnet=*)
434443
ARG_IPv6_SUBNET="${1#*=}"
@@ -1199,7 +1208,8 @@ run_function docker_check_network_exists $DOCKER_NETWORK_NAME
11991208

12001209
if [[ ! "$DOCKER_NETWORK_EXISTS" == true ]]; then
12011210

1202-
run_function docker_network_create $DOCKER_NETWORK_NAME $ACTIVATE_IPV6 $ARG_IPv6_SUBNET
1211+
IPv4_SUBNET=${ARG_IPv4_SUBNET:-"172.17.0.0/16"} # required argument for function docker_network_create
1212+
run_function docker_network_create $DOCKER_NETWORK_NAME $IPv4_SUBNET $ACTIVATE_IPV6 $ARG_IPv6_SUBNET
12031213

12041214
if [[ "$ERROR_DOCKER_NETWORK_CREATE" == true ]]; then
12051215
echoerror "There was error when creating the docker network $DOCKER_NETWORK_NAME [IPv6 enabled: ${ACTIVATE_IPV6:-'false'} ]" false

0 commit comments

Comments
 (0)