From 6de23e96decb7d93edb167c7b60875651ebc5944 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 3 Dec 2019 10:34:19 +0100 Subject: [PATCH] Avoided to show mount lines again after -dummy umount --- xorriso-dd-target/xorriso-dd-target | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/xorriso-dd-target/xorriso-dd-target b/xorriso-dd-target/xorriso-dd-target index f3a881fd..e171682a 100755 --- a/xorriso-dd-target/xorriso-dd-target +++ b/xorriso-dd-target/xorriso-dd-target @@ -260,7 +260,7 @@ plug_in_watcher() { # <<< Mock-up to save USB socket wear-off by erasing items from old_device_list # <<< Their presence in new_device_list will let them appear as fresh plugs -# old_device_list=' '$(echo -n $old_device_list | sed -e 's/sde//')' ' +# old_device_list=' '$(echo -n $old_device_list | sed -e 's/sdc//')' ' echo "Found and noted as _not_ desired: $old_device_list" >&2 echo >&2 @@ -570,11 +570,14 @@ write_image() { done # Check again if any mount points still exist - list_mounted_of "$2" - if test -n "$mounted_devs" -a -z "$dummy_run" + if test -z "$dummy_run" then - echo "FAILURE: $sudo_cmd $umount_cmd could not remove all mounts: $mounted_devs" >&2 - return 7 + list_mounted_of "$2" + if test -n "$mounted_devs" + then + echo "FAILURE: $sudo_cmd $umount_cmd could not remove all mounts: $mounted_devs" >&2 + return 7 + fi fi fi @@ -587,9 +590,9 @@ write_image() { then echo " $sudo_cmd $dd_cmd if='${1}' bs=1M of=/dev/${2} ; sync" else - echo "--- not activated yet ---" - echo "Would do: $sudo_cmd $dd_cmd if='${1}' bs=1M of=/dev/${2} ; sync" - echo "--- not activated yet ---" + echo "Performing:" + echo " $sudo_cmd $dd_cmd if='${1}' bs=1M of=/dev/${2} ; sync" +# $sudo_cmd $dd_cmd if='${1}' bs=1M of=/dev/${2} ; sync fi # >>> ??? Erase possible GPT backup table at end of device ? @@ -651,7 +654,7 @@ then then if test -n "$do_plug_test" then - echo + echo >&2 echo "Step 3:" >&2 if test -n "$dummy_run" then