1a84601801d5bd045712787a3ef59313795389a1vboxsync# Copyright (C) 2007-2013 Oracle Corporation
1a84601801d5bd045712787a3ef59313795389a1vboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
1a84601801d5bd045712787a3ef59313795389a1vboxsync# available from http://www.virtualbox.org. This file is free software;
1a84601801d5bd045712787a3ef59313795389a1vboxsync# you can redistribute it and/or modify it under the terms of the GNU
1a84601801d5bd045712787a3ef59313795389a1vboxsync# General Public License (GPL) as published by the Free Software
1a84601801d5bd045712787a3ef59313795389a1vboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
1a84601801d5bd045712787a3ef59313795389a1vboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1a84601801d5bd045712787a3ef59313795389a1vboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1a84601801d5bd045712787a3ef59313795389a1vboxsync# Setup environment.
1a84601801d5bd045712787a3ef59313795389a1vboxsync test -n "$(sudo -u "$FORCED_USER" launchctl list | grep $ITEM_ID)" && loaded="YES"
1a84601801d5bd045712787a3ef59313795389a1vboxsync echo "Unloading previously installed service: $ITEM_ID"
1a84601801d5bd045712787a3ef59313795389a1vboxsync sudo -u "$FORCED_USER" launchctl unload -F "$ITEM_PATH/$ITEM_ID.plist"
1a84601801d5bd045712787a3ef59313795389a1vboxsync sudo -u "$FORCED_USER" launchctl load -F "$ITEM_PATH/$ITEM_ID.plist"
1a84601801d5bd045712787a3ef59313795389a1vboxsyncunload_service "org.virtualbox.additions.vboxservice" "/Library/LaunchDaemons" "root"
1a84601801d5bd045712787a3ef59313795389a1vboxsyncunload_service "org.virtualbox.additions.vboxclient" "/Library/LaunchAgents" "${USER}"
1a84601801d5bd045712787a3ef59313795389a1vboxsync test -n "$(kextstat | grep $kext_item)" && loaded="YES"
1a84601801d5bd045712787a3ef59313795389a1vboxsync echo "Unloading $item kernel extension..."
1a84601801d5bd045712787a3ef59313795389a1vboxsyncecho "Loading newly installed kernel extensions."
1a84601801d5bd045712787a3ef59313795389a1vboxsyncload_service "org.virtualbox.additions.vboxservice" "/Library/LaunchDaemons" "root"
1a84601801d5bd045712787a3ef59313795389a1vboxsyncload_service "org.virtualbox.additions.vboxclient" "/Library/LaunchAgents" "${USER}"
1a84601801d5bd045712787a3ef59313795389a1vboxsyncecho "Done."