load.sh revision 95b10998d08fa1fb5b30d3c2ee25f2fdc2cfa9b2
d5d12f5d4455786efdce0a22f09ec396bcb60718vboxsync#!/bin/bash
18589e4730562fe0d41783eb53496bea5a47af97vboxsync
d5d12f5d4455786efdce0a22f09ec396bcb60718vboxsync#
18589e4730562fe0d41783eb53496bea5a47af97vboxsync# For development.
18589e4730562fe0d41783eb53496bea5a47af97vboxsync#
d5d12f5d4455786efdce0a22f09ec396bcb60718vboxsync# Copyright (C) 2006-2007 innotek GmbH
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync#
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# available from http://www.virtualbox.org. This file is free software;
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# you can redistribute it and/or modify it under the terms of the GNU
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# General Public License as published by the Free Software Foundation,
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# distribution. VirtualBox OSE is distributed in the hope that it will
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync# be useful, but WITHOUT ANY WARRANTY of any kind.
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsyncDIR="VBoxDrv.kext"
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsyncif [ ! -d "$DIR" ]; then
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync echo "Cannot find $DIR or it's not a directory..."
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync exit 1;
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsyncfi
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsyncif [ -n "$*" ]; then
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsync OPTS="$*"
a16eb14ad7a4b5ef91ddc22d3e8e92d930f736fcvboxsyncelse
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync OPTS="-t"
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsyncfi
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsync
1c94c0a63ba68be1a7b2c640e70d7a06464e4fcavboxsynctrap "sudo chown -R `whoami` $DIR; exit 1" INT
95b10998d08fa1fb5b30d3c2ee25f2fdc2cfa9b2vboxsyncset -x
130a462bf46409a9352467033f92e02e4b249879vboxsyncsudo chown -R root:wheel "$DIR"
130a462bf46409a9352467033f92e02e4b249879vboxsyncsudo chmod -R o-rwx "$DIR"
130a462bf46409a9352467033f92e02e4b249879vboxsyncsync
130a462bf46409a9352467033f92e02e4b249879vboxsyncsudo kextload $OPTS "$DIR"
130a462bf46409a9352467033f92e02e4b249879vboxsyncsudo chown -R `whoami` "$DIR"
130a462bf46409a9352467033f92e02e4b249879vboxsyncsudo chmod 666 /dev/vboxdrv
18589e4730562fe0d41783eb53496bea5a47af97vboxsync