Created
July 19, 2023 08:51
-
-
Save thomasmerz/1788a4efbc8cf25cce0556b6168e46da to your computer and use it in GitHub Desktop.
Update Extension Pack for VirtualBox automatically (grep -qE "$(date +\%Y-\%m-\%d).*virtualbox" /var/log/zypp/history)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd "$HOME/VirtualBox VMs/" || exit 1 | |
# https://www.virtualbox.org/manual/ch08.html | |
VERSION=$(VBoxManage -v|cut -d '_' -f1|cut -d "r" -f1) | |
CURRENT=$(VBoxManage list extpacks|grep "Version:"|awk '{print $2}') | |
# MUST BE RUN AFTER 'get_vboxguestadditions.sh' !!! | |
[ "${VERSION}" == "${CURRENT}" ] && exit 1 | |
EXTPACK=Oracle_VM_VirtualBox_Extension_Pack-${VERSION}.vbox-extpack | |
URL=http://download.virtualbox.org/virtualbox/${VERSION}/${EXTPACK} | |
wget "$URL" --no-clobber --quiet && { | |
sudo VBoxManage extpack install --replace "$EXTPACK" \ | |
--accept-license=xyz &>/dev/null || \ | |
VBoxManage list extpacks | mail -s "[Info] Fehler beim Update von $EXTPACK" thomas; } | |
#VBoxManage list extpacks | |
#rm Oracle_VM_VirtualBox_Extension_Pack-$VERSION.vbox-extpack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
--accept-license
needs a value that you will get by this: