#!/bin/sh

URL=http://majexam.pau.eisti.fr/
FICHIER=usr_crypted.img

SATA=`lspci | grep ICH6`
SWAP=6
CRYPT=8

if [ "a$SATA" = "a" ]; then
        DEV=sda
else
	DEV=hda
fi



echo $DEV


if [ "a$1" != "a" ]; then

	echo "Vous devez avoir au moins 6go de libre sur / pour pouvoir telecharger l'image"
	read toto
	cd /root/
	wget -c $URL$FICHIER 
	dd if=$FICHIER of=/dev/$DEV$CRYPT
	rm -rf $FICHIER

else

	wget $URL$FICHIER -O /dev/$DEV$CRYPT

fi
