]> git.pld-linux.org Git - packages/VirtualBox.git/blame_incremental - VirtualBox-vboxnetflt.init
- release 4
[packages/VirtualBox.git] / VirtualBox-vboxnetflt.init
... / ...
CommitLineData
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 return
24 fi
25
26 modprobe -s $VBOX_MODULE
27 touch /var/lock/subsys/vboxnetflt
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
36condrestart() {
37 if [ ! -f /var/lock/subsys/vboxnetflt ]; then
38 RETVAL=$1
39 return
40 fi
41
42 stop
43 start
44}
45
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 ;;
59 try-restart)
60 condrestart 0
61 ;;
62 force-reload)
63 condrestart 7
64 ;;
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 *)
74 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
75 exit 3
76esac
77
78exit $RETVAL
This page took 0.069821 seconds and 4 git commands to generate.