VirtualBox

source: vbox/trunk/src/VBox/Installer/solaris/checkinstall.sh@ 26600

Last change on this file since 26600 was 22367, checked in by vboxsync, 15 years ago

Solaris/Installer: checkinstall unplumb vboxnet0 ipv6 too.

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1#!/bin/sh
2## @file
3# Sun VirtualBox
4# VirtualBox checkinstall script for Solaris.
5#
6
7#
8# Copyright (C) 2009 Sun Microsystems, Inc.
9#
10# This file is part of VirtualBox Open Source Edition (OSE), as
11# available from http://www.virtualbox.org. This file is free software;
12# you can redistribute it and/or modify it under the terms of the GNU
13# General Public License (GPL) as published by the Free Software
14# Foundation, in version 2 as it comes in the "COPYING" file of the
15# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17#
18# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19# Clara, CA 95054 USA or visit http://www.sun.com if you need
20# additional information or have any questions.
21#
22
23abort_error()
24{
25 echo "## Please close all VirtualBox processes and re-run this installer."
26 exit 1
27}
28
29
30# Check if VBoxSVC is currently running
31VBOXSVC_PID=`ps -eo pid,fname | grep VBoxSVC | grep -v grep | awk '{ print $1 }'`
32if test ! -z "$VBOXSVC_PID" && test "$VBOXSVC_PID" -ge 0; then
33 echo "## VirtualBox's VBoxSVC (pid $VBOXSVC_PID) still appears to be running."
34 abort_error
35fi
36
37# Check if the Zone Access service is holding open vboxdrv, if so stop & remove it
38servicefound=`svcs -H "svc:/application/virtualbox/zoneaccess" 2> /dev/null | grep '^online'`
39if test ! -z "$servicefound"; then
40 echo "## VirtualBox's zone access service appears to still be running."
41 echo "## Halting & removing zone access service..."
42 /usr/sbin/svcadm disable -s svc:/application/virtualbox/zoneaccess
43 /usr/sbin/svccfg delete svc:/application/virtualbox/zoneaccess
44fi
45
46# Check if the Web service is running, if so stop & remove it
47servicefound=`svcs -H "svc:/application/virtualbox/webservice" 2> /dev/null | grep '^online'`
48if test ! -z "$servicefound"; then
49 echo "## VirtualBox web service appears to still be running."
50 echo "## Halting & removing webservice..."
51 /usr/sbin/svcadm disable -s svc:/application/virtualbox/webservice
52 /usr/sbin/svccfg delete svc:/application/virtualbox/webservice
53fi
54
55# Check if vboxnet is still plumbed, if so try unplumb it
56BIN_IFCONFIG=`which ifconfig 2> /dev/null`
57if test -x "$BIN_IFCONFIG"; then
58 vboxnetup=`$BIN_IFCONFIG vboxnet0 >/dev/null 2>&1`
59 if test "$?" -eq 0; then
60 echo "## VirtualBox NetAdapter is still plumbed"
61 echo "## Trying to remove old NetAdapter..."
62 $BIN_IFCONFIG vboxnet0 unplumb
63 if test "$?" -ne 0; then
64 echo "## VirtualBox NetAdapter 'vboxnet0' couldn't be unplumbed (probably in use)."
65 abort_error
66 fi
67 fi
68 vboxnetup=`$BIN_IFCONFIG vboxnet0 inet6 >/dev/null 2>&1`
69 if test "$?" -eq 0; then
70 echo "## VirtualBox NetAdapter (Ipv6) is still plumbed"
71 echo "## Trying to remove old NetAdapter..."
72 $BIN_IFCONFIG vboxnet0 inet6 unplumb
73 if test "$?" -ne 0; then
74 echo "## VirtualBox NetAdapter 'vboxnet0' IPv6 couldn't be unplumbed (probably in use)."
75 abort_error
76 fi
77 fi
78fi
79
80exit 0
81
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette