1 | #!/bin/bash
|
---|
2 | ## @file
|
---|
3 | # For development, loads the support driver.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2010-2014 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | if test -n "$Path" -a -z "$PATH"; then
|
---|
19 | export PATH="$Path"
|
---|
20 | fi
|
---|
21 |
|
---|
22 | MY_DIR=`cd "${0}/.." && cmd /c cd | kmk_sed -e 's,\\\\,/,g' `
|
---|
23 | if [ ! -d "${MY_DIR}" ]; then
|
---|
24 | echo "Cannot find ${MY_DIR} or it's not a directory..."
|
---|
25 | exit 1;
|
---|
26 | fi
|
---|
27 | echo MY_DIR=$MY_DIR
|
---|
28 |
|
---|
29 | set -e
|
---|
30 | cd "$MY_DIR"
|
---|
31 | set +e
|
---|
32 |
|
---|
33 |
|
---|
34 | #
|
---|
35 | # Query the status of the drivers.
|
---|
36 | #
|
---|
37 | for drv in VBoxNetAdp VBoxNetAdp6 VBoxNetFlt VBoxNetLwf VBoxUSBMon VBoxUSB VBoxDrv;
|
---|
38 | do
|
---|
39 | if sc query $drv > /dev/null; then
|
---|
40 | STATE=`sc query $drv \
|
---|
41 | | kmk_sed -e '/^ *STATE /!d' -e 's/^[^:]*: [0-9 ]*//' \
|
---|
42 | -e 's/ */ /g' \
|
---|
43 | -e 's/^ *//g' \
|
---|
44 | -e 's/ *$//g' \
|
---|
45 | `
|
---|
46 | echo "load.sh: $drv - $STATE"
|
---|
47 | else
|
---|
48 | echo "load.sh: $drv - not configured, probably."
|
---|
49 | fi
|
---|
50 | done
|
---|
51 |
|
---|
52 | set -e
|
---|
53 | set -x
|
---|
54 |
|
---|
55 | #
|
---|
56 | # Invoke the uninstallers.
|
---|
57 | #
|
---|
58 | for uninst in NetAdpUninstall.exe NetAdp6Uninstall.exe USBUninstall.exe NetFltUninstall.exe NetLwfUninstall.exe SUPUninstall.exe;
|
---|
59 | do
|
---|
60 | if test -f ${MY_DIR}/$uninst; then
|
---|
61 | ${MY_DIR}/$uninst
|
---|
62 | fi
|
---|
63 | done
|
---|
64 |
|
---|
65 | #
|
---|
66 | # Invoke the installer.
|
---|
67 | #
|
---|
68 | if test "$1" != "-u" -a "$1" != "--uninstall"; then
|
---|
69 | for inst in SUPInstall.exe;
|
---|
70 | do
|
---|
71 | if test -f ${MY_DIR}/$inst; then
|
---|
72 | ${MY_DIR}/$inst
|
---|
73 | fi
|
---|
74 | done
|
---|
75 | fi
|
---|
76 |
|
---|
77 | echo "load.sh: Successfully installed SUPDrv (aka VBoxDrv)"
|
---|
78 | exit 0
|
---|
79 |
|
---|