From 4b14a49f00036518b610199c20df4c5a6e2ae71b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 18:51:47 +0200 Subject: Adding debian version 7.0.6-1. Signed-off-by: Daniel Baumann --- debian/postinst.in | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 debian/postinst.in (limited to 'debian/postinst.in') diff --git a/debian/postinst.in b/debian/postinst.in new file mode 100644 index 0000000..143bd20 --- /dev/null +++ b/debian/postinst.in @@ -0,0 +1,34 @@ +#!/bin/sh +#set -e + +version=#VERSION# +hash=292961aa8723b54f96f89f6d8abf7d8e29259d94b7de831dbffb9ae15d346434 +file=Oracle_VM_VirtualBox_Extension_Pack-$version.vbox-extpack +accept_license=33d7284dc4a0ece381196fda3cfe2ed0e1e8e7ed7f27b9a9ebc4ee22e24bd23c + +error () +{ + if [ "$1" = "hash" ] ; then + echo "Hash mismatch $file: expected $hash, removing the file." + rm -f /usr/share/virtualbox-ext-pack/$file + elif [ "$1" = "install" ]; then + echo "Installation error: License key incorrect or unknown problem during installation." + fi + exit 1 +} + +# Source debconf library. +. /usr/share/debconf/confmodule + +if [ "$1" = "configure" ] ; then + 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 https://download.virtualbox.org/virtualbox/$version/$file + echo "$hash $file" | sha256sum -c > /dev/null 2>&1 || error hash + vboxmanage extpack install --replace --accept-license=$accept_license $file || error install + rm -f /usr/share/virtualbox-ext-pack/$file +fi + +#DEBHELPER# -- cgit v1.2.3