]> git.pld-linux.org Git - packages/VirtualBox.git/blame - VirtualBox-vboxnetflt.init
- release 8
[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() {
f8d383ed
ER
22 if [ -f /var/lock/subsys/vboxnetflt ]; then
23 return
cff279b9 24 fi
f8d383ed
ER
25
26 modprobe -s $VBOX_MODULE
27 touch /var/lock/subsys/vboxnetflt
cff279b9 28}
29
30stop() {
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/vboxnetflt
34}
35
b1e7712f 36condrestart() {
f8d383ed 37 if [ ! -f /var/lock/subsys/vboxnetflt ]; then
b1e7712f 38 RETVAL=$1
f8d383ed 39 return
b1e7712f 40 fi
f8d383ed
ER
41
42 stop
43 start
b1e7712f
JB
44}
45
cff279b9 46RETVAL=0
47# See how we were called.
48case "$1" in
49 start)
50 start
51 ;;
52 stop)
53 stop
54 ;;
55 restart)
56 stop
57 start
58 ;;
b1e7712f
JB
59 try-restart)
60 condrestart 0
61 ;;
62 force-reload)
63 condrestart 7
64 ;;
cff279b9 65 status)
66 if ! is_module $VBOX_MODULE; then
67 echo "$VBOX_MODULE module is loaded"
68 else
69 echo "$VBOX_MODULE module is not loaded"
70 RETVAL=3
71 fi
72 ;;
73 *)
b1e7712f 74 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
cff279b9 75 exit 3
76esac
77
78exit $RETVAL
This page took 0.031645 seconds and 4 git commands to generate.