diff --git a/bin/down b/bin/down index 19a04b2..73702bf 100755 --- a/bin/down +++ b/bin/down @@ -1,3 +1,8 @@ #!/bin/bash basedir=$(dirname "$0")/.. -mutagen-compose -f "$basedir"/docker-compose.yml down +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + IP_ADDR=$(ifconfig -l | xargs -n1 ipconfig getifaddr) +elif [[ "$OSTYPE" == "darwin"* ]]; then + IP_ADDR=$(ip route get 1 | awk '{print $NF;exit}') +fi +PRIVATE_NETWORK_IP=${ADDR} mutagen-compose -f "$basedir"/docker-compose.yml down diff --git a/bin/up b/bin/up index 779166a..32a330c 100755 --- a/bin/up +++ b/bin/up @@ -8,4 +8,10 @@ mutagen daemon start echo -e ${prefix}The mutagen daemon will stay running until you stop it manually with \`mutagen daemon stop\`.$suffix echo -e ${prefix}Running mutagen-compose...$suffix -PRIVATE_NETWORK_IP=$(ifconfig -l | xargs -n1 ipconfig getifaddr) mutagen-compose -f "$basedir"/docker-compose.yml up --build --detach + +if [[ "$OSTYPE" == "linux-gnu"* ]]; then + IP_ADDR=$(ifconfig -l | xargs -n1 ipconfig getifaddr) +elif [[ "$OSTYPE" == "darwin"* ]]; then + IP_ADDR=$(ip route get 1 | awk '{print $NF;exit}') +fi +PRIVATE_NETWORK_IP=${ADDR} mutagen-compose -f "$basedir"/docker-compose.yml up --build --detach