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