Last active
September 19, 2018 21:05
-
-
Save stripedpurple/33a5ffbd820df66b237d18b7d811de4f to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# Check to see if the script was run as Root | |
if [[ "$EUID" -ne 0 ]]; then | |
log err "Sorry, you need to run this as root" | |
exit 1 | |
fi | |
sudo apt install pv -y | |
umount /dev/mmcblk* | |
external=$(lsblk /dev/sd* | grep "^sd.*/media/ubuntu/" | grep -o "/media/ubuntu/.*") | |
cd $external | |
img=$(ls -1r *.img.gz | tail -1) | |
gunzip -c $img | pv > /dev/mmcblk* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment