Skip to content

Commit

Permalink
src/winusb: Fix wrong usage of and-list
Browse files Browse the repository at this point in the history
Signed-off-by: 林博仁 <[email protected]>
  • Loading branch information
brlin-tw committed Jun 5, 2017
1 parent 60b8387 commit 9be41ac
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions src/winusb
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ init(){
"${source_fs_mountpoint}"\
"${target_partition}"\
"${target_fs_mountpoint}"\
|| echo_with_color red "Error: Failed to mount filesystems"\
&& exit 1
|| (
echo_with_color red "Error: Failed to mount filesystems"\
exit 1
)

check_target_filesystem_free_space\
"${target_fs_mountpoint}"\
Expand Down Expand Up @@ -379,36 +381,45 @@ mount_source_and_target_filesystem(){
mkdir\
--parents\
"${source_fs_mountpoint}"\
|| echo_with_color red "${FUNCNAME[0]}: Error: Unable to create \"${source_fs_mountpoint}\" mountpoint directory"\
&& return 1
|| (
echo_with_color red "${FUNCNAME[0]}: Error: Unable to create \"${source_fs_mountpoint}\" mountpoint directory"
return 1
)
if [ -f "${source_media}" ]; then # ${source_media} is an ISO image
mount\
--options loop,ro\
--types udf,iso9660\
"${source_media}"\
"${source_fs_mountpoint}"\
|| echo_with_color red "${FUNCNAME[0]}: Error: Unable to mount source media"\
&& return 1
|| (
echo_with_color red "${FUNCNAME[0]}: Error: Unable to mount source media"
return 1
)
else # ${source_media} is a real optical disk drive (block device)
mount\
--options ro\
"${source_media}"\
"${source_fs_mountpoint}"\
|| echo_with_color red "${FUNCNAME[0]}: Error: Unable to mount source media"\
&& return 1
|| (
echo_with_color red "${FUNCNAME[0]}: Error: Unable to mount source media"
return 1
)
fi

mkdir\
--parents\
"${target_fs_mountpoint}"\
|| echo_with_color red "${FUNCNAME[0]}: Error: Unable to create \"${target_fs_mountpoint}\" mountpoint directory"\
&& return 1
|| (
echo_with_color red "${FUNCNAME[0]}: Error: Unable to create \"${target_fs_mountpoint}\" mountpoint directory"
return 1
)
mount\
"${target_partition}"\
"${target_fs_mountpoint}"\
|| echo_with_color red "${FUNCNAME[0]}: Error: Unable to mount target partition"\
&& return 1

|| (
echo_with_color red "${FUNCNAME[0]}: Error: Unable to mount target partition"
return 1
)
}; declare -fr mount_source_and_target_filesystem

setup_traps(){
Expand Down

0 comments on commit 9be41ac

Please sign in to comment.