From 99aeeb677edf0bccdb37c3594f6f9feccd11153b Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 12 Feb 2020 16:03:18 +0100 Subject: [PATCH] unmount_device() use double quote when needed --- init.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/init.sh b/init.sh index 96bbb6b..5b37f29 100755 --- a/init.sh +++ b/init.sh @@ -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 - for part in $mounted_part - do - if [ -d $part ] - then - printf "Unmount %s\n " "$part" - umount $part --recursive - fi - done -fi + 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" ] + then + printf "Unmount %s\n " "$part" + umount "$part" --recursive + fi + done + fi } efi_create_key_structure () {