From 367bbd16d5cabb7da52f863ae78cf66c4d45e046 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Fri, 15 Apr 2016 12:47:31 +0200 Subject: iso2usb.sh: only umount if the directory was actually mounted. --- iso2usb.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'iso2usb.sh') diff --git a/iso2usb.sh b/iso2usb.sh index 5a3d87d..2ae1171 100644 --- a/iso2usb.sh +++ b/iso2usb.sh @@ -556,7 +556,7 @@ rm ${USBMNT}/boot/extlinux/isolinux.* /sbin/extlinux --install ${USBMNT}/boot/extlinux # No longer needed: -/sbin/umount ${USBMNT} +if /sbin/mount |grep -qw ${USBMNT} ; then /sbin/umount ${USBMNT} ; fi if [ $EFIBOOT -eq 1 ]; then # Mount the EFI partition and copy /EFI as well as /boot directories into it: @@ -570,8 +570,8 @@ if [ $EFIBOOT -eq 1 ]; then fi # No longer needed: -/sbin/umount ${USBMNT} -/sbin/umount ${EFIMNT} +if /sbin/mount |grep -qw ${USBMNT} ; then /sbin/umount ${USBMNT} ; fi +if /sbin/mount |grep -qw ${EFIMNT} ; then /sbin/umount ${EFIMNT} ; fi # Unmount/remove stuff: cleanup -- cgit v1.2.3