]> git.pld-linux.org Git - packages/VirtualBox.git/blame - VirtualBox-vboxnetflt.init
- up to 4.2.10
[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#
1434d1f0 7# description: Oracle VirtualBox is a general-purpose full virtualizer for x86 \
cff279b9 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
cff279b9 15VBOX_MODULE="vboxnetflt"
16
17# Get service config - may override defaults
18[ -f /etc/sysconfig/virtualbox ] && . /etc/sysconfig/virtualbox
19
20start() {
f8d383ed
ER
21 if [ -f /var/lock/subsys/vboxnetflt ]; then
22 return
cff279b9 23 fi
f8d383ed
ER
24
25 modprobe -s $VBOX_MODULE
26 touch /var/lock/subsys/vboxnetflt
cff279b9 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 35condrestart() {
f8d383ed 36 if [ ! -f /var/lock/subsys/vboxnetflt ]; then
b1e7712f 37 RETVAL=$1
f8d383ed 38 return
b1e7712f 39 fi
f8d383ed
ER
40
41 stop
42 start
b1e7712f
JB
43}
44
cff279b9 45RETVAL=0
46# See how we were called.
47case "$1" in
48 start)
49 start
50 ;;
51 stop)
52 stop
53 ;;
54 restart)
55 stop
56 start
57 ;;
b1e7712f
JB
58 try-restart)
59 condrestart 0
60 ;;
61 force-reload)
62 condrestart 7
63 ;;
cff279b9 64 status)
65 if ! is_module $VBOX_MODULE; then
66 echo "$VBOX_MODULE module is loaded"
67 else
68 echo "$VBOX_MODULE module is not loaded"
69 RETVAL=3
70 fi
71 ;;
72 *)
b1e7712f 73 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
cff279b9 74 exit 3
75esac
76
77exit $RETVAL
This page took 0.033544 seconds and 4 git commands to generate.