smeserver-virtualbox/root/etc/e-smith/events/actions/vbox_install_extension_pack

19 lines
768 B
Bash

#!/usr/bin/bash
# Download and install the Oracle VM VirtualBox Extension Pack for the currently installed version of virtualbox
vboxver=$(/usr/bin/vboxmanage --version)
vboxver="${vboxver%r*}"
extver=$(/usr/bin/vboxmanage list extpacks | grep Version)
extver="${extver#*:}"
extver="${extver#"${extver%%[![:space:]]*}"}"
if [ "$extver" == "$vboxver" ]
then
echo "Version: $extver Extension Pack already installed"
else
/usr/bin/cd /tmp
/usr/bin/wget https://download.virtualbox.org/virtualbox/$vboxver/Oracle_VM_VirtualBox_Extension_Pack-$vboxver.vbox-extpack
/usr/bin/vboxmanage extpack install --replace Oracle_VM_VirtualBox_Extension_Pack-$vboxver.vbox-extpack --accept-license=56be48f923303c8cababb0bb4c478284b688ed23f16d775d729b89a2e8e5f9eb
fi