server/linx: update: Changed installed version detection to use zero-lines

dehydrated
Felix Stupp 4 years ago
parent 7d2f8d32d0
commit 34614b7d6a
Signed by: zocker
GPG Key ID: 93E1BD26F6B02FB7

@ -21,10 +21,10 @@ function correctPermissions() {
# Check newest version installed
installed="$(
(ls "$BIN_DIR" |
grep --only-matching --perl-regexp '(?<=-)v\d+(\.\d+)*(?=_)' |
sort --version-sort --reverse --unique |
head --lines=1) ||
(find "$BIN_DIR" -type f -maxdepth 1 -printf '%f\0' |
grep --null-data --only-matching --perl-regexp '(?<=-)v\d+(\.\d+)*(?=_)' |
sort --zero-terminated --version-sort --reverse --unique |
head --zero-terminated --lines=1) ||
true
)";

Loading…
Cancel
Save