1 | #!/bin/sh
|
---|
2 | # $Id: pkginstall.sh 44211 2012-12-28 21:20:59Z vboxsync $
|
---|
3 | ## @file
|
---|
4 | #
|
---|
5 | # VirtualBox postinstall script for Solaris.
|
---|
6 | #
|
---|
7 | # If you just installed VirtualBox using IPS/pkg(5), you should run this
|
---|
8 | # script once to avoid rebooting the system before using VirtualBox.
|
---|
9 | #
|
---|
10 |
|
---|
11 | #
|
---|
12 | # Copyright (C) 2009-2012 Oracle Corporation
|
---|
13 | #
|
---|
14 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
15 | # available from http://www.alldomusa.eu.org. This file is free software;
|
---|
16 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
17 | # General Public License (GPL) as published by the Free Software
|
---|
18 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
19 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
20 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
21 | #
|
---|
22 |
|
---|
23 | if test "$1" != "--srv4"; then
|
---|
24 | # IPS package
|
---|
25 | echo "Checking for older & partially installed bits..."
|
---|
26 | ISIPS="--ips"
|
---|
27 | else
|
---|
28 | # SRv4 package
|
---|
29 | echo "Checking for older bits..."
|
---|
30 | ISIPS=""
|
---|
31 | fi
|
---|
32 |
|
---|
33 | # If PKG_INSTALL_ROOT is undefined or NULL, redefine to '/' and carry on.
|
---|
34 | ${PKG_INSTALL_ROOT:=/}/opt/VirtualBox/vboxconfig.sh --preremove --fatal "$ISIPS"
|
---|
35 |
|
---|
36 | if test "$?" -eq 0; then
|
---|
37 | echo "Installing new ones..."
|
---|
38 | $PKG_INSTALL_ROOT/opt/VirtualBox/vboxconfig.sh --postinstall
|
---|
39 | rc=$?
|
---|
40 | if test "$rc" -ne 0; then
|
---|
41 | echo 1>&2 "## Completed but with errors."
|
---|
42 | rc=1
|
---|
43 | else
|
---|
44 | if test "$1" != "--srv4"; then
|
---|
45 | echo "Post installation completed successfully!"
|
---|
46 | fi
|
---|
47 | fi
|
---|
48 | else
|
---|
49 | echo 1>&2 "## ERROR!! Failed to remove older/partially installed bits."
|
---|
50 | rc=1
|
---|
51 | fi
|
---|
52 |
|
---|
53 | exit "$rc"
|
---|
54 |
|
---|