From: Guo Xiang Tan Date: Fri, 15 Jul 2016 07:22:15 +0000 (+0800) Subject: Add config options to skip assignment of a mac address. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=cad2919f12b414b229b8c3e2a56baa5c3f4e40a3;p=discourse_docker.git Add config options to skip assignment of a mac address. --- diff --git a/launcher b/launcher index e188c57..196c1e9 100755 --- a/launcher +++ b/launcher @@ -16,6 +16,7 @@ usage () { echo "Options:" echo " --skip-prereqs Don't check launcher prerequisites" echo " --docker-args Extra arguments to pass when running docker" + echo " --skip-mac-address Don't assign a mac address" exit 1 } @@ -31,6 +32,9 @@ while [ ${#} -gt 0 ]; do --skip-prereqs) SKIP_PREREQS="1" ;; + --skip-mac-address) + SKIP_MAC_ADDRESS="1" + ;; --docker-args) user_args="$2" shift @@ -448,7 +452,10 @@ run_start() { # docker added more hostname rules hostname=${hostname//_/-} - 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/'")" + + if [ -z "$SKIP_MAC_ADDRESS" ] ; then + 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/'")" + fi set -x $docker_path run $user_args $links $attach_on_run $restart_policy "${env[@]}" -h "$hostname" \