unmount_device() use double quote when needed

This commit is contained in:
Yorick Barbanneau 2020-02-12 16:03:18 +01:00
parent 5ed96fcd13
commit 99aeeb677e

13
init.sh
View file

@ -170,18 +170,19 @@ create_dir(){
# unmount if device is mounted
umount_device (){
local mounted_part=$(mount | grep "${1}[0-9]" | awk '{print $3}')
if [ ! "$mounted_part" == "" ]
then
local mounted_part
mounted_part=$(mount | grep "${1}[0-9]" | awk '{print $3}')
if [ ! "$mounted_part" == "" ]
then
for part in $mounted_part
do
if [ -d $part ]
if [ -d "$part" ]
then
printf "Unmount %s\n " "$part"
umount $part --recursive
umount "$part" --recursive
fi
done
fi
fi
}
efi_create_key_structure () {