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