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

25
init.sh
View file

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