diff options
author | root <root@rshg054.dnsready.net> | 2012-07-27 00:02:04 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-07-27 00:02:04 +0000 |
commit | 1616f43507a7f8785a479ecf6ce905828a232f02 (patch) | |
tree | 2da0cc5a8e57effad5bcd327be1957b187b67f36 /libre/virtualbox-libre/vboxservice.rc | |
parent | c4c5143448e3be178c254e8f9f1ab24661dc3b20 (diff) |
Fri Jul 27 00:02:04 UTC 2012
Diffstat (limited to 'libre/virtualbox-libre/vboxservice.rc')
-rw-r--r-- | libre/virtualbox-libre/vboxservice.rc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libre/virtualbox-libre/vboxservice.rc b/libre/virtualbox-libre/vboxservice.rc new file mode 100644 index 000000000..5a62d69a3 --- /dev/null +++ b/libre/virtualbox-libre/vboxservice.rc @@ -0,0 +1,39 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/${0##*/} + +name=VBoxService +PID=$(pidof -o %PPID $name) + +case "$1" in + start) + stat_busy 'Starting VirtualBox Guest Service' + [[ -z "$PID" ]] && ${name} $VBOX_SERVICE_OPTION &>/dev/null \ + && { add_daemon ${0##*/}; stat_done; } \ + || { stat_fail; exit 1; } + ;; + stop) + stat_busy 'Stopping VirtualBox Guest Service' + [[ -n "$PID" ]] && kill $PID &>/dev/null \ + && { rm_daemon ${0##*/}; stat_done; } \ + || { stat_fail; exit 1; } + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + stat_busy 'Checking VirtualBox Guest Service status' + ck_status ${0##*/} + ;; + *) + echo "usage: ${0##*/} {start|stop|restart|status}" >&2 + exit 1 +esac + +exit 0 + +# vim:set ts=2 sw=2 ft=sh et: |