diff --git a/bin/sd-copy b/bin/sd-copy new file mode 100755 index 0000000..3038c78 --- /dev/null +++ b/bin/sd-copy @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -E -o errexit -o nounset -o pipefail + +if [ $# -lt 2 ]; then + echo "Not enough arguments!" + echo "Use: $0 [args]" + echo "For example: $0 ubuntu.img /dev/sdc" + exit 10 +fi + +SRC="$1" +shift +DST="$1" +shift + +echo "dd if=$SRC of=$DST bs=32MiB status=progress conv=fsync $*" +dd if="$SRC" of="$DST" bs=32MiB status=progress conv=fsync "$@"