postflight revision 29e18dff973632afcdb1ebf98dbc9d38f80a7792
#!/bin/sh
# $Id$
## @file
# Reloads the new kernel extension at the end of installation.
#
#
# Copyright (C) 2007-2013 Oracle Corporation
#
# This file is part of VirtualBox Open Source Edition (OSE), as
# available from http://www.virtualbox.org. This file is free software;
# you can redistribute it and/or modify it under the terms of the GNU
# General Public License (GPL) as published by the Free Software
# Foundation, in version 2 as it comes in the "COPYING" file of the
# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
#
#
# Unload any old extension that might be loaded already (ignore failures).
#
sync
if kextstat -lb org.virtualbox.kext.VBoxNetAdp 2>&1 | grep -q org.virtualbox.kext.VBoxNetAdp; then
kextunload -m org.virtualbox.kext.VBoxNetAdp
fi
if kextstat -lb org.virtualbox.kext.VBoxNetFlt 2>&1 | grep -q org.virtualbox.kext.VBoxNetFlt; then
kextunload -m org.virtualbox.kext.VBoxNetFlt
fi
if kextstat -lb org.virtualbox.kext.VBoxUSB 2>&1 | grep -q org.virtualbox.kext.VBoxUSB; then
kextunload -m org.virtualbox.kext.VBoxUSB
fi
if kextstat -lb org.virtualbox.kext.VBoxDrv 2>&1 | grep -q org.virtualbox.kext.VBoxDrv; then
kextunload -m org.virtualbox.kext.VBoxDrv
fi
#
# Load the extension, exit on first error.
#
sync
set -e
kextload '/Library/Application Support/VirtualBox/VBoxDrv.kext'
kextload -d '/Library/Application Support/VirtualBox/VBoxDrv.kext' '/Library/Application Support/VirtualBox/VBoxUSB.kext'
kextload -d '/Library/Application Support/VirtualBox/VBoxDrv.kext' '/Library/Application Support/VirtualBox/VBoxNetFlt.kext'
kextload -d '/Library/Application Support/VirtualBox/VBoxDrv.kext' '/Library/Application Support/VirtualBox/VBoxNetAdp.kext'