summaryrefslogtreecommitdiffstats
path: root/debian/postinst.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 14:23:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 14:23:43 +0000
commit0b791ed33c38a43d404b926e29895be018d0d089 (patch)
tree5ee6f295f1d87a9027820aba90599a016773c4c8 /debian/postinst.in
parentAdding upstream version 6.1.22. (diff)
downloadvirtualbox-ext-pack-debian.tar.xz
virtualbox-ext-pack-debian.zip
Adding debian version 6.1.22-1.debian/6.1.22-1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/postinst.in')
-rw-r--r--debian/postinst.in34
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/postinst.in b/debian/postinst.in
new file mode 100644
index 0000000..ca4052d
--- /dev/null
+++ b/debian/postinst.in
@@ -0,0 +1,34 @@
+#!/bin/sh
+#set -e
+
+version=#VERSION#
+hash=6d33d9cc1c5a8f8a2a70e5aaaa778a341322d2ba7eb34f7de420fb5f312b9e87
+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#