OSDN Git Service

[update] : Simple prompt
authorhayao <hayao@fascode.net>
Sun, 23 May 2021 08:30:31 +0000 (17:30 +0900)
committerhayao <hayao@fascode.net>
Sun, 23 May 2021 08:30:31 +0000 (17:30 +0900)
tools/clean.sh

index f3cb779..057f00a 100755 (executable)
@@ -91,7 +91,7 @@ _umount() { if mountpoint -q "${1}"; then umount -lf "${1}"; fi; }
 
 # Unmount chroot dir
 umount_chroot () {
-    "${tools_dir}/umount.sh" "${work_dir}"
+    "${tools_dir}/umount.sh" -d "${work_dir}" -m 3
 }
 
 # Usage: getclm <number>
@@ -149,13 +149,8 @@ work_dir="$(realpath "${work_dir}")"
 if [[ ! "${noconfirm}" = true ]] && (( "$(find "${work_dir}" -type f 2> /dev/null | wc -l)" != 0 )); then
     msg_warn "Forcibly unmount all devices mounted under the following directories and delete them recursively."
     msg_warn "${work_dir}"
-    msg_warn -n "Are you sure you want to continue?"
-    read -n 1 yesorno
-    if [[ "${yesorno}" = "y" ]] || [[ "${yesorno}" = "" ]]; then
-        echo
-    else
-        exit 1
-    fi
+    echo -e "Press Enter to continue or Ctrl + C to cancel."
+    read
 fi