]> git.pld-linux.org Git - packages/VirtualBox.git/blob - VirtualBox-vboxsf.init
- release 9
[packages/VirtualBox.git] / VirtualBox-vboxsf.init
1 #!/bin/sh
2 #
3 # virtualbox    VirtualBox virtualizer for x86 hardware
4 #
5 # chkconfig:    345 84 25
6 #
7 # description:  InnoTek VirtualBox is a general-purpose full virtualizer for x86 
8 #               hardware. Targeted at server, desktop and embedded use.
9 #
10 # $Id$
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 VBOX_DEVICE="/dev/vboxsf"
16 VBOX_MODULE="vboxsf"
17
18 # Get service config - may override defaults
19 [ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
20
21 start() {
22         if [ -f /var/lock/subsys/vboxsf ]; then
23                 return
24         fi
25
26         modprobe -s $VBOX_MODULE
27         touch /var/lock/subsys/vboxsf
28 }
29
30 stop() {
31         # NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea
32         /sbin/rmmod $VBOX_MODULE
33         rm -f /var/lock/subsys/vboxsf
34 }
35
36 RETVAL=0
37 # See how we were called.
38 case "$1" in
39   start)
40         start
41         ;;
42   stop)
43         stop
44         ;;
45   restart)
46         stop
47         start
48         ;;
49   status)
50         if ! is_module $VBOX_MODULE; then
51                 echo "$VBOX_MODULE module is loaded"
52         else
53                 echo "$VBOX_MODULE module is not loaded"
54                 RETVAL=3
55         fi
56         ;;
57   *)
58         msg_usage "$0 {start|stop|restart|status}"
59         exit 3
60 esac
61
62 exit $RETVAL
This page took 0.024695 seconds and 3 git commands to generate.