diff options
Diffstat (limited to 'debian/postinst.in')
-rw-r--r-- | debian/postinst.in | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/debian/postinst.in b/debian/postinst.in new file mode 100644 index 0000000..1ed888b --- /dev/null +++ b/debian/postinst.in @@ -0,0 +1,31 @@ +#!/bin/sh +set -e + +version=#VERSION# +hash=8887d5dd9dd26bd376926b38857715e28f2d678b6d3a034144ddc3fde4a387d9 +file=Oracle_VM_VirtualBox_Extension_Pack-$version.vbox-extpack +accept_license=56be48f923303c8cababb0bb4c478284b688ed23f16d775d729b89a2e8e5f9eb + +error () +{ + echo "Hash mismatch $file: expected $hash, or wrong accept-license key, removing the file." + rm -f /usr/share/virtualbox-ext-pack/$file + exit 1 +} + +# Source debconf library. +. /usr/share/debconf/confmodule + +if [ "$1" = "configure" ] ; then + echo "removing old virtualbox extension packs" + rm -f /usr/share/virtualbox-ext-pack/Oracle_VM_VirtualBox_Extension_Pack-*.vbox-extpack + cd /usr/share/virtualbox-ext-pack + echo "virtualbox-ext-pack: downloading: https://download.virtualbox.org/virtualbox/$version/$file" + echo "The file will be downloaded into /usr/share/virtualbox-ext-pack" + /usr/bin/wget -q -N http://download.virtualbox.org/virtualbox/$version/$file + echo "$hash $file" | sha256sum -c > /dev/null 2>&1 || error + vboxmanage extpack install --replace --accept-license=$accept_license $file || error + #rm -f /usr/share/virtualbox-ext-pack/$file +fi + +#DEBHELPER# |