From 00fe01019264c3a2341e01fa7c4b903266368ec3 Mon Sep 17 00:00:00 2001 From: Samuel Vermeulen Date: Mon, 13 Jul 2020 21:58:24 +0200 Subject: [PATCH] Telechargement de l'iso + verif md5 --- stick_build | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/stick_build b/stick_build index 12aa2ee..b2fdb7c 100755 --- a/stick_build +++ b/stick_build @@ -1,17 +1,38 @@ #!/bin/bash -# stick_build /path/live-image.iso /dev/sdX +# stick_build /dev/sdX + +set -e + +ISO="live-svpro_gnu-amd64.iso" + +# Recuperation iso +echo "Téléchargement de l'iso..." +sleep 5 +wget -O ${ISO} https://nuage.svnet.fr/f/0566c7a699eb4960b2ef/?dl=1 +wget -O ${ISO}.md5 https://nuage.svnet.fr/f/06d1ae10101949bc84d9/?dl=1 +echo "Vérification de l'image..." + +if ! md5sum -c ${ISO}.md5 + then + echo "ISO Corompue. Abandon !!" + rm -f ${ISO} ${ISO}.md5 + exit 1 +fi # Copie de l'image iso sur clé -dd if=$1 of=$2 bs=4M status=progress +echo "Transfert en cours..." +dd if=${ISO} of=$1 bs=4M status=progress sync # Création de la partition dédiée à la persistence -printf 'n\np\n\n\n\nw' | fdisk $2 -mkfs.ext4 -L persistence ${2}3 +echo "Création de la persistence..." +sleep 5 +printf 'n\np\n\n\n\nw' | fdisk $1 +mkfs.ext4 -L persistence ${1}3 # Configuratio de la partition -mount ${2}3 /mnt +mount ${1}3 /mnt echo / union > /mnt/persistence.conf umount /mnt