freebsd-ports/emulators/virtualbox-ose-additions/files/vboxguest.in
Bernhard Froehlich 09b600e31e - Use correct modulname for kldstat
- Bump PORTREVISION

PR:		ports/168897
Submitted by:	VVD <vvd@unislabs.com>
2012-08-04 06:41:24 +00:00

53 lines
948 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: vboxguest
# REQUIRE: FILESYSTEMS
# BEFORE: netif
# KEYWORD: nojail
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# vboxguest_enable (bool): Set to NO by default.
# Set it to YES to enable vboxguest on startup
. /etc/rc.subr
name="vboxguest"
rcvar=vboxguest_enable
start_cmd="vboxguest_start"
stop_cmd="vboxguest_stop"
vboxguest_start()
{
if ! kldstat -q -m pci/vboxguest;
then
if ! kldload vboxguest > /dev/null 2>&1;
then
warn "Can't load vboxguest module."
return 1
fi
fi
}
vboxguest_stop()
{
if kldstat -q -m pci/vboxguest;
then
if ! kldunload vboxguest > /dev/null 2>&1;
then
warn "Can't unload vboxguest module."
return 1
fi
fi
}
load_rc_config $name
: ${vboxguest_enable="NO"}
run_rc_command "$1"