summaryrefslogtreecommitdiff
path: root/community-testing/virtualbox/vbox-service.rc
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-10-27 23:14:53 +0000
committerroot <root@rshg054.dnsready.net>2011-10-27 23:14:53 +0000
commit0424b5fc47f106db6498c4cda3476e1d49fe0f82 (patch)
treef5c4ef7fa0139ce627e74b3bc58f35115c7e09ff /community-testing/virtualbox/vbox-service.rc
parent84fe155e2233db86fcc13134d8802ba1dab0ae83 (diff)
Thu Oct 27 23:14:53 UTC 2011
Diffstat (limited to 'community-testing/virtualbox/vbox-service.rc')
-rwxr-xr-xcommunity-testing/virtualbox/vbox-service.rc39
1 files changed, 39 insertions, 0 deletions
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: