mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
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: Joakim Roubert <joakim.roubert@axis.com>
This commit is contained in:
parent
dfd4e42e57
commit
80a15bebc0
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user