Commit 80a15beb authored by Joakim Roubert's avatar Joakim Roubert Committed by Brad Davidson

install.sh: Use built-in shell functionality instead of awk

If install.sh relies on awk, install.sh malfunctions when run on a device with a limited environment where awk is not available. This patch replaces the use of awk with built-in shell script functionality. Fixes: #3737 Signed-off-by: 's avatarJoakim Roubert <joakim.roubert@axis.com>
parent dfd4e42e
......@@ -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'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment