]> git.pld-linux.org Git - packages/VirtualBox.git/blame - VirtualBox-vboxnetflt.init
- rel 3
[packages/VirtualBox.git] / VirtualBox-vboxnetflt.init
CommitLineData
cff279b9 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
15VBOX_DEVICE="/dev/vboxnetflt"
16VBOX_MODULE="vboxnetflt"
17
18# Get service config - may override defaults
19[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
20
21start() {
22 if [ ! -f /var/lock/subsys/vboxnetflt ]; then
23 modprobe -s $VBOX_MODULE
24 # set proper /dev/vboxdrv for systems with static dev
25 touch /var/lock/subsys/vboxnetflt
26 fi
27}
28
29stop() {
30 # NOTE: rmmod will wait if device is in use, so automatic rmmod probably is not the best idea
31 /sbin/rmmod $VBOX_MODULE
32 rm -f /var/lock/subsys/vboxnetflt
33}
34
b1e7712f
JB
35condrestart() {
36 if [ -f /var/lock/subsys/vboxnetflt ]; then
37 stop
38 start
39 else
40 RETVAL=$1
41 fi
42}
43
cff279b9 44RETVAL=0
45# See how we were called.
46case "$1" in
47 start)
48 start
49 ;;
50 stop)
51 stop
52 ;;
53 restart)
54 stop
55 start
56 ;;
b1e7712f
JB
57 try-restart)
58 condrestart 0
59 ;;
60 force-reload)
61 condrestart 7
62 ;;
cff279b9 63 status)
64 if ! is_module $VBOX_MODULE; then
65 echo "$VBOX_MODULE module is loaded"
66 else
67 echo "$VBOX_MODULE module is not loaded"
68 RETVAL=3
69 fi
70 ;;
71 *)
b1e7712f 72 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
cff279b9 73 exit 3
74esac
75
76exit $RETVAL
This page took 0.031859 seconds and 4 git commands to generate.