From def172587ff8927072fbef6f9eb5e8fde11a9c37 Mon Sep 17 00:00:00 2001 From: Martin Blazik Date: Mon, 10 Jan 2022 15:35:15 +0100 Subject: [PATCH] Write ISO image to SD card script --- bin/sd-copy | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 bin/sd-copy 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 "$@"