Skip to content

Commit 803b98a

Browse files
author
Nick A
committed
fixed bashism and POSIX
1 parent 16f8341 commit 803b98a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

core/tabs/applications-setup/virtualization/virtualbox.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ virtualBoxPermissions() {
5454

5555
getLatestVersion() {
5656
vboxGitVersion=$(wget "https://raw.githubusercontent.com/VirtualBox/virtualbox/refs/heads/main/Version.kmk" -q -O -)
57-
fullVersion=$(echo "$vboxGitVersion" | sed '/^#/d' | cut -d'=' -f2 | cut -d'$' -f1 | xargs | sed 's/ /./g')
58-
version=$(sed 's/.\{2\}$//' <<< "$fullVersion")
57+
version=$(echo "$vboxGitVersion" | sed '/^#/d' | cut -d'=' -f2 | cut -d'$' -f1 | xargs | sed 's/ /./g' | cut -c -3)
5958
}
6059

6160
checkVirtualBox() {
@@ -65,7 +64,7 @@ checkVirtualBox() {
6564
currentVersion=$(vboxmanage --version | cut -d'r' -f1)
6665
getLatestVersion
6766

68-
if [ "$(echo "${currentVersion%.*}")" = "$fullVersion" ]; then
67+
if [ "${currentVersion%.*}" = "$version" ]; then
6968
printf "%b\n" "Latest version of VirtualBox already installed"
7069
else
7170
installVirtualBox

0 commit comments

Comments
 (0)