]> git.pld-linux.org Git - packages/VirtualBox.git/blame - VirtualBox-vboxnetadp.init
- identify our build as _PLD, see http://www.virtualbox.org/wiki/Editions
[packages/VirtualBox.git] / VirtualBox-vboxnetadp.init
CommitLineData
c1cd3b9a 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/vboxnetctl"
16VBOX_MODULE="vboxnetadp"
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/vboxnetadp ]; then
23 return
c1cd3b9a 24 fi
f8d383ed
ER
25
26 modprobe -s $VBOX_MODULE
27 touch /var/lock/subsys/vboxnetadp
c1cd3b9a 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/vboxnetadp
34}
35
36condrestart() {
37 if [ -f /var/lock/subsys/vboxnetadp ]; then
38 stop
39 start
40 else
41 RETVAL=$1
42 fi
43}
44
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 ;;
58 try-restart)
59 condrestart 0
60 ;;
61 force-reload)
62 condrestart 7
63 ;;
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 *)
73 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
74 exit 3
75esac
76
77exit $RETVAL
This page took 0.073076 seconds and 4 git commands to generate.