Add check for the exit code of fdisk
This commit is contained in:
parent
6535897c9b
commit
b403c7d040
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user