diff --git a/install.sh b/install.sh index 9909c07119..6ec1cd2cab 100755 --- a/install.sh +++ b/install.sh @@ -617,7 +617,11 @@ getshims() { killtree $({ set +x; } 2>/dev/null; getshims; set -x) do_unmount_and_remove() { - awk -v path="$1" '$2 ~ ("^" path) { print $2 }' /proc/self/mounts | sort -r | xargs -r -t -n 1 sh -c 'umount "$0" && rm -rf "$0"' + set +x + while read -r _ path _; do + case "$path" in $1*) echo "$path" ;; esac + done < /proc/self/mounts | sort -r | xargs -r -t -n 1 sh -c 'umount "$0" && rm -rf "$0"' + set -x } do_unmount_and_remove '/run/k3s'