8 BINARY
="$INSTALL_DIR/vboxwebsrv"
11 stat_busy
"Starting VirtualBox Web Service";
12 if ! pidof
-o %PPID
$BINARY >/dev
/null
; then
13 [[ "$VBOXWEB_USER" ]] || stat_die
14 lsmod |
grep -q "vboxdrv[^_-]" || stat_die
16 [[ "$VBOXWEB_HOST" ]] && PARAMS
+=" -H $VBOXWEB_HOST"
17 [[ "$VBOXWEB_PORT" ]] && PARAMS
+=" -p $VBOXWEB_PORT"
18 [[ "$VBOXWEB_TIMEOUT" ]] && PARAMS
+=" -t $VBOXWEB_TIMEOUT"
19 [[ "$VBOXWEB_CHECK_INTERVAL" ]] && PARAMS
+=" -i $VBOXWEB_CHECK_INTERVAL"
20 [[ "$VBOXWEB_THREADS" ]] && PARAMS
+=" -T $VBOXWEB_THREADS"
21 [[ "$VBOXWEB_KEEPALIVE" ]] && PARAMS
+=" -k $VBOXWEB_KEEPALIVE"
22 [[ "$VBOXWEB_LOGFILE" ]] && PARAMS
+=" -F $VBOXWEB_LOGFILE"
23 # prevent inheriting this setting to VBoxSVC
24 unset VBOX_RELEASE_LOG_DEST
25 su
- $VBOXWEB_USER -c "$BINARY $PARAMS" &>/dev
/null
26 # ugly: wait until the final process has forked
28 if pidof
-o %PPID
$BINARY >/dev
/null
; then
40 stat_busy
"Stopping VirtualBox Web Service"
41 PID
=$
(pidof
-o %PPID
$BINARY)
42 [[ $PID ]] && kill $PID &>/dev
/null
43 if ! pidof
-o %PPID
$BINARY >/dev
/null
; then
56 stat_busy
"Checking for VirtualBox Web Service"
57 if pidof
-o %PPID
$BINARY >/dev
/null
; then
82 echo "Usage: $0 {start|stop|restart|status}"
86 # vim:set ts=2 sw=2 ft=sh et: