postflight revision 66ab05d147fcb24a5fec1cd3c37a1799db26c804
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# Reloads the new kernel extension at the end of installation.
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# Copyright (C) 2007-2013 Oracle Corporation
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# available from http://www.virtualbox.org. This file is free software;
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# you can redistribute it and/or modify it under the terms of the GNU
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# General Public License (GPL) as published by the Free Software
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# Make sure the old startup items are gone.
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync rm -vf "/Library/StartupItems/VirtualBox/StartupParameters.plist"
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync rm -vf "/Library/StartupItems/VirtualBox/VirtualBox"
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync rm -vf "/Library/StartupItems/VirtualBox/Resources/English.lproj/Localizable.strings"
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync test -d "/Library/StartupItems/VirtualBox/Resources/English.lproj/" && rmdir "/Library/StartupItems/VirtualBox/Resources/English.lproj/"
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync test -d "/Library/StartupItems/VirtualBox/Resources/" && rmdir "/Library/StartupItems/VirtualBox/Resources/"
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync test -d "/Library/StartupItems/VirtualBox/" && rmdir "/Library/StartupItems/VirtualBox/"
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# Install the launchd script.
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsyncrm -vf "/Library/LaunchDaemons/org.virtualbox.startup.plist"
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsyncln -s "../Application Support/VirtualBox/LaunchDaemons/org.virtualbox.startup.plist" \
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync "/Library/LaunchDaemons/org.virtualbox.startup.plist"
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsync# Unload any old extension that might be loaded already (ignore failures).
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsyncif kextstat -lb org.virtualbox.kext.VBoxNetAdp 2>&1 | grep -q org.virtualbox.kext.VBoxNetAdp; then
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsyncif kextstat -lb org.virtualbox.kext.VBoxNetFlt 2>&1 | grep -q org.virtualbox.kext.VBoxNetFlt; then
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsyncif kextstat -lb org.virtualbox.kext.VBoxUSB 2>&1 | grep -q org.virtualbox.kext.VBoxUSB; then
41a839133aad7c96a0d55d927dc3475d0cbe9c22vboxsyncif kextstat -lb org.virtualbox.kext.VBoxDrv 2>&1 | grep -q org.virtualbox.kext.VBoxDrv; then
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'