-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for internet connection on make up #45
Comments
I don't know if you're still interested in this. I took the check below from one of my Bash scripts and changed it to fit. You could stick it in a Bash script and alias it.
#!/bin/bash
#-- Variable 'packetLoss' must be null (or > 100) before pinging. Because '0' means no packet loss.
packetLoss=
acceptablePacketLoss=0
packetLoss=$(echo $(ping -qc 10 wordpress.com) | sed -r 's|\s*.*,\s*([[:digit:]]*)% packet loss,.*ms$|\1|')
if [ "$packetLoss" -le "$acceptablePacketLoss" ]; then
make up #-- docker-compose up -d
return 0
else
echo -e "Packet loss is $packetLoss%\nAcceptable packet loss is $acceptablePacketLoss%\nSkipping!"
return 1
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way to add a check on the docker.mk file to see if the there is an internet connection and not do a
docker-compose pull
if not connected?I sometimes run a dev environment without internet (airplane) and this command fails. I do get around it by running
docker-compose up -d
, but was wondering...The text was updated successfully, but these errors were encountered: