Created
May 10, 2017 21:09
-
-
Save computermouth/4d7c9bfa0100d406e8e7d26aede8b07f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# source a file of key/value that happens to be bash compliant | |
source ${DIRECTORY}/gadget.cfg | |
# get docker image size | |
SIZE="$(${DOCKER} images --format "{{.Size}}" ${name}_${uuid}-img)" | |
# get size in bytes from MB | |
B_SIZE=$(echo "scale=0; (1000*1000*$(echo ${SIZE} | ${SED} 's% MB%%g'))/1" | ${BC} -l) | |
# get transfer rate | |
echo " - Estimated transfer time: $(echo "scale=1; ${B_SIZE}/800000" | bc -l)s" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment