From f482dc1bd42773a12552e5a60df119410a0d8bd8 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 11 Oct 2011 23:14:37 +0000 Subject: Tue Oct 11 23:14:37 UTC 2011 --- community-testing/virtualbox/vbox-service.rc | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 community-testing/virtualbox/vbox-service.rc (limited to 'community-testing/virtualbox/vbox-service.rc') diff --git a/community-testing/virtualbox/vbox-service.rc b/community-testing/virtualbox/vbox-service.rc new file mode 100755 index 000000000..c1af2134d --- /dev/null +++ b/community-testing/virtualbox/vbox-service.rc @@ -0,0 +1,39 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/vbox-service + +name=VBoxService +PID=$(pidof -o %PPID $name) + +case "$1" in + start) + stat_busy "Starting $name service" + [[ -z "$PID" ]] && ${name} $VBOX_SERVICE_OPTION &>/dev/null \ + && { add_daemon $name; stat_done; } \ + || { stat_fail; exit 1; } + ;; + stop) + stat_busy "Stopping $name service" + [[ -n "$PID" ]] && kill $PID &>/dev/null \ + && { rm_daemon $name; stat_done; } \ + || { stat_fail; exit 1; } + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + stat_busy "Checking $name status"; + ck_status $name + ;; + *) + echo "usage: $0 {start|stop|restart|status}" + exit 1 +esac + +exit 0 + +# vim:set ts=2 sw=2 ft=sh et: -- cgit v1.2.3-54-g00ecf