Add check for the exit code of fdisk

This commit is contained in:
Filippo Bedendo Bordon 2012-02-09 19:12:11 +01:00
parent 6535897c9b
commit b403c7d040

View File

@ -175,8 +175,7 @@ org.freedesktop.UDisks.Device DeviceIsMounted`
if [ "$DEVICEISMOUNTED" = "true" ]; then if [ "$DEVICEISMOUNTED" = "true" ]; then
LANG=C udisks --unmount ${SELECT_USB}1 | grep failed && { LANG=C udisks --unmount ${SELECT_USB}1 | grep failed && {
echo "Error: fail to umount the usb key (${SELECT_USB}1)" errorAndExit "Error: fail to umount the usb key (${SELECT_USB}1)"
exit 1
} }
fi fi
set_pbar 2 set_pbar 2
@ -184,7 +183,11 @@ set_pbar 2
set_status "Formattazione della chiavetta in corso..." set_status "Formattazione della chiavetta in corso..."
sudo fdisk $SELECT_USB < ./fdisk_template sudo fdisk $SELECT_USB < ./fdisk_template
if [ "$?" != "0" ]; then
errorAndExit "Error: fdisk ended with error"
fi
set_pbar 5 set_pbar 5
sudo mkfs.ext3 ${SELECT_USB}1 -L openmamba_live sudo mkfs.ext3 ${SELECT_USB}1 -L openmamba_live
sleep 1 sleep 1
LANG=C udisks --mount ${SELECT_USB}1 LANG=C udisks --mount ${SELECT_USB}1