-
Notifications
You must be signed in to change notification settings - Fork 0
/
vbox_fuse_switch.sh
35 lines (32 loc) · 1.32 KB
/
vbox_fuse_switch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
function status() {
kextstat | grep org.virtualbox.kext > /dev/null 2>&1 ;
vbox=$((1-$?))
kextstat | grep com.github.osxfuse > /dev/null 2>&1 ;
fuse=$((1-$?))
}
status
if [ "$1" == "vbox" ] ; then
if [ $vbox == 1 ] ; then
echo "Already vbox"
else
sudo kextunload -b com.github.osxfuse.filesystems.osxfuse
sudo kextutil "/Library/Application Support/VirtualBox/VBoxDrv.kext" -r "/Library/Application Support/VirtualBox"
sudo kextutil "/Library/Application Support/VirtualBox/VBoxNetAdp.kext" -r "/Library/Application Support/VirtualBox"
sudo kextutil "/Library/Application Support/VirtualBox/VBoxNetFlt.kext" -r "/Library/Application Support/VirtualBox"
sudo kextutil "/Library/Application Support/VirtualBox/VBoxUSB.kext" -r "/Library/Application Support/VirtualBox"
fi
elif [ "$1" == "fuse" ] ; then
if [ $fuse == 1 ] ; then
echo "Already fuse"
else
sudo kextunload -b org.virtualbox.kext.VBoxUSB -b org.virtualbox.kext.VBoxNetFlt -b org.virtualbox.kext.VBoxNetAdp
sudo kextunload -b org.virtualbox.kext.VBoxDrv
sudo kextutil /Library/Filesystems/osxfuse.fs/Contents/Extensions/10.13/osxfuse.kext
fi
elif [ "$1" == "status" ] ; then
echo "vbox = $vbox"
echo "fuse = $fuse"
else
echo "Run $0 <vbox|fuse|status>"
fi