Skip to content

Commit cad2919

Browse files
committed
Add config options to skip assignment of a mac address.
1 parent 573617e commit cad2919

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

launcher

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ usage () {
1616
echo "Options:"
1717
echo " --skip-prereqs Don't check launcher prerequisites"
1818
echo " --docker-args Extra arguments to pass when running docker"
19+
echo " --skip-mac-address Don't assign a mac address"
1920
exit 1
2021
}
2122

@@ -31,6 +32,9 @@ while [ ${#} -gt 0 ]; do
3132
--skip-prereqs)
3233
SKIP_PREREQS="1"
3334
;;
35+
--skip-mac-address)
36+
SKIP_MAC_ADDRESS="1"
37+
;;
3438
--docker-args)
3539
user_args="$2"
3640
shift
@@ -448,7 +452,10 @@ run_start() {
448452
# docker added more hostname rules
449453
hostname=${hostname//_/-}
450454

451-
mac_address="--mac-address $($docker_path run $user_args -i --rm -a stdout -a stderr $image /bin/sh -c "echo $hostname | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/'")"
455+
456+
if [ -z "$SKIP_MAC_ADDRESS" ] ; then
457+
mac_address="--mac-address $($docker_path run $user_args -i --rm -a stdout -a stderr $image /bin/sh -c "echo $hostname | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/'")"
458+
fi
452459

453460
set -x
454461
$docker_path run $user_args $links $attach_on_run $restart_policy "${env[@]}" -h "$hostname" \

0 commit comments

Comments
 (0)