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

View file

@ -170,15 +170,16 @@ 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
mounted_part=$(mount | grep "${1}[0-9]" | awk '{print $3}')
if [ ! "$mounted_part" == "" ] if [ ! "$mounted_part" == "" ]
then then
for part in $mounted_part for part in $mounted_part
do do
if [ -d $part ] if [ -d "$part" ]
then then
printf "Unmount %s\n " "$part" printf "Unmount %s\n " "$part"
umount $part --recursive umount "$part" --recursive
fi fi
done done
fi fi